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 <jorgen.lind@nokia.com>
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);
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();