From 6a1f52c90d3bbe19b8be68494d16e8af25559b96 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 19 Jul 2017 13:01:24 +0100 Subject: [PATCH] Reset mFrameCallback in destruction Otherwise we crash if we call reset twice. For example if we call setParent and setVisible together. Change-Id: I7f07825167bf8c3236a80e649a6d6805fd6c868b Reviewed-by: Johan Helsing --- src/plugins/platforms/wayland/qwaylandwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 5585fd52aba..98d0603ccbd 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -249,8 +249,10 @@ void QWaylandWindow::reset() if (isInitialized()) destroy(); - if (mFrameCallback) + if (mFrameCallback) { wl_callback_destroy(mFrameCallback); + mFrameCallback = nullptr; + } } QWaylandWindow *QWaylandWindow::fromWlSurface(::wl_surface *surface)