From 586fc2a9ead06a8478bdc380b775f18000741745 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 19 Oct 2010 09:40:25 +0100 Subject: Suppress call to controlVisibilityChanged for null control pointer At this point, old_winid may be null. Passing a null pointer to controlVisibilityChanged is actually a no-op, due to the 'QWidgetPrivate::mapper->contains(control)' check, but suppressing the function call altogether clarifies the intent of the code slightly. Reviewed-by: Jason Barron --- src/gui/kernel/qwidget_s60.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 031892d..cf4bdf1 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -709,7 +709,8 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) // old_winid may not have received a 'not visible' visibility // changed event before being destroyed; make sure that it is // removed from the backing store's list of visible windows. - S60->controlVisibilityChanged(old_winid, false); + if (old_winid) + S60->controlVisibilityChanged(old_winid, false); setWinId(0); -- cgit v0.12