qt6/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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4728>
This commit is contained in:
Matthew Waters 2023-05-29 17:02:29 +10:00 committed by GStreamer Marge Bot
parent c64efe494d
commit 74f914077d

View file

@ -156,7 +156,7 @@ shared_render_data_free (struct SharedRenderData * data)
}
data->m_context = nullptr;
if (data->m_surface)
delete data->m_surface;
data->m_surface->deleteLater();
data->m_surface = nullptr;
}
@ -268,7 +268,6 @@ bool CreateSurfaceWorker::event(QEvent * ev)
g_mutex_lock (&m_sharedRenderData->lock);
m_sharedRenderData->m_surface = new GstQt6BackingSurface;
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);