From: Laszlo Agocs Date: Fri, 13 Apr 2012 09:22:14 +0000 (+0300) Subject: Do not assert when closing dialogs X-Git-Tag: TIZEN~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6ec82c38f0ed751d2e7c67c0732d2d5c043c4a84;p=profile%2Fivi%2Fqtwayland.git Do not assert when closing dialogs The leave event may arrive after the window is gone, resulting in a null surface. The callback should do nothing in this case. Change-Id: I36ec4cb1615f518de57b7de98206cdb8986405e4 Reviewed-by: Jørgen Lind --- diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index 2be5946..7ac47f9 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp @@ -362,7 +362,7 @@ void QWaylandInputDevice::inputHandlePointerEnter(void *data, Q_UNUSED(sy); QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data; - // shouldn't get pointer leave with no surface + // shouldn't get pointer enter with no surface Q_ASSERT(surface); QWaylandWindow *window = (QWaylandWindow *) wl_surface_get_user_data(surface); @@ -379,8 +379,10 @@ void QWaylandInputDevice::inputHandlePointerLeave(void *data, Q_UNUSED(input_device); QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data; - // shouldn't get pointer leave with no surface - Q_ASSERT(surface); + // The event may arrive after destroying the window, indicated by + // a null surface. + if (!surface) + return; QWaylandWindow *window = (QWaylandWindow *) wl_surface_get_user_data(surface); window->handleMouseLeave();