diff --git a/src/backends/x11/standalone/x11_standalone_egl_backend.cpp b/src/backends/x11/standalone/x11_standalone_egl_backend.cpp index 86cf69baee..5b30466dd0 100644 --- a/src/backends/x11/standalone/x11_standalone_egl_backend.cpp +++ b/src/backends/x11/standalone/x11_standalone_egl_backend.cpp @@ -82,6 +82,8 @@ EglBackend::~EglBackend() // if the render backend is about to be destroyed. RenderLoopPrivate::get(m_backend->renderLoop())->invalidate(); + m_query.reset(); + if (isFailed() && m_overlayWindow) { m_overlayWindow->destroy(); } diff --git a/src/backends/x11/standalone/x11_standalone_glx_backend.cpp b/src/backends/x11/standalone/x11_standalone_glx_backend.cpp index b8081a8b48..efae3b38a8 100644 --- a/src/backends/x11/standalone/x11_standalone_glx_backend.cpp +++ b/src/backends/x11/standalone/x11_standalone_glx_backend.cpp @@ -153,6 +153,8 @@ GlxBackend::~GlxBackend() // if the render backend is about to be destroyed. RenderLoopPrivate::get(m_backend->renderLoop())->invalidate(); + m_query.reset(); + if (isFailed()) { m_overlayWindow->destroy(); }