qmlglsink: fix crash when created/destroyed in quick succession
authorBastien Reboulet <bastien.reboulet@gmail.com>
Fri, 16 Oct 2020 23:05:45 +0000 (16:05 -0700)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 20 Oct 2020 18:12:20 +0000 (18:12 +0000)
commit27ecd2c30d732d4ccb058157b8d95dc02aebe834
treeff4f69b5e847707d1e15cc945e2499a2bcac33d6
parentd885cc0f1ad68b60f54ac533e3ef252ff52e9853
qmlglsink: fix crash when created/destroyed in quick succession

The crash is caused by a race condition where the render thread
calls a method on the QtGLVideoItem instance that was
previously destroyed by the main thread.
Also, less frequently, QtGLVideoItem::onSceneGraphInitialized
is called when QQuickItem::window is null, also causing a crash.

Fixes #798

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/777>
ext/qt/qtitem.cc