diff options
-rw-r--r-- | src/compositor/compositor_api/qwaylandsurface.cpp | 3 | ||||
-rw-r--r-- | src/compositor/extensions/qwaylandwlshell.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index a82c93f7b..8c866351f 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -391,7 +391,8 @@ QWaylandSurface::QWaylandSurface(QWaylandSurfacePrivate &dptr) QWaylandSurface::~QWaylandSurface() { Q_D(QWaylandSurface); - QWaylandCompositorPrivate::get(d->compositor)->unregisterSurface(this); + if (d->compositor) + QWaylandCompositorPrivate::get(d->compositor)->unregisterSurface(this); d->notifyViewsAboutDestruction(); } diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index 66aeb64ba..924234887 100644 --- a/src/compositor/extensions/qwaylandwlshell.cpp +++ b/src/compositor/extensions/qwaylandwlshell.cpp @@ -466,7 +466,8 @@ QWaylandWlShellSurface::QWaylandWlShellSurface(QWaylandWlShell *shell, QWaylandS QWaylandWlShellSurface::~QWaylandWlShellSurface() { Q_D(QWaylandWlShellSurface); - QWaylandWlShellPrivate::get(d->m_shell)->unregisterShellSurface(this); + if (d->m_shell) + QWaylandWlShellPrivate::get(d->m_shell)->unregisterShellSurface(this); } /*! |