From c64efe494da561f5bed3b9226e37c88e3de7c4e4 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Mon, 29 May 2023 17:01:01 +1000 Subject: [PATCH] qt/glrenderer: don't attempt to use QWindow from non-Qt main thread Use QObject::deleteLater() to schedule deletion in the main thread. Remove the moveToThread of the QWindow. Part-of: --- subprojects/gst-plugins-good/ext/qt/qtglrenderer.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-good/ext/qt/qtglrenderer.cc b/subprojects/gst-plugins-good/ext/qt/qtglrenderer.cc index ce453a9249..ef5270bc85 100644 --- a/subprojects/gst-plugins-good/ext/qt/qtglrenderer.cc +++ b/subprojects/gst-plugins-good/ext/qt/qtglrenderer.cc @@ -152,7 +152,7 @@ shared_render_data_free (struct SharedRenderData * data) delete data->m_context; data->m_context = nullptr; if (data->m_surface) - delete data->m_surface; + data->m_surface->deleteLater(); data->m_surface = nullptr; } @@ -281,7 +281,6 @@ bool CreateSurfaceWorker::event(QEvent * ev) g_mutex_lock (&m_sharedRenderData->lock); m_sharedRenderData->m_surface = new GstBackingSurface; m_sharedRenderData->m_surface->create(); - m_sharedRenderData->m_surface->moveToThread (m_sharedRenderData->m_renderThread); GST_TRACE ("%p created surface %p", m_sharedRenderData, m_sharedRenderData->m_surface); g_cond_broadcast (&m_sharedRenderData->cond);