summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto@qt.io>2022-03-30 15:37:36 +1000
committerRafael Roquetto <rafael.roquetto@qt.io>2022-04-01 17:42:42 +1000
commit2d37f8bc9a1fb15ffbddb1c75cbdce18023e9c07 (patch)
tree1f93cf8b47da1d3d0a7201b269b49a571108ce36
parent3283c88caaf125a44bd1aca4328114d387663316 (diff)
QVideoWindow: disconnect videoFrameChanged signal when destroying
Prevent signal from invoking methods on a half-destroyed object. It can happen when a video sink is trying to set a default frame prior to the sink itself being destructed, if that destruction is a side-effect of the video window destuctor itself. Change-Id: I49ad1e2d0fe28040bf32648fa76e3de8b08d0f0e Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 71c5377235b9e37be9c0eb25671e23484e289fad) Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
-rw-r--r--src/multimedia/video/qvideowindow.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/multimedia/video/qvideowindow.cpp b/src/multimedia/video/qvideowindow.cpp
index 9055b4167..3732fcfde 100644
--- a/src/multimedia/video/qvideowindow.cpp
+++ b/src/multimedia/video/qvideowindow.cpp
@@ -100,6 +100,9 @@ QVideoWindowPrivate::QVideoWindowPrivate(QVideoWindow *q)
QVideoWindowPrivate::~QVideoWindowPrivate()
{
freeTextures();
+
+ QObject::disconnect(m_sink.get(), &QVideoSink::videoFrameChanged,
+ q, &QVideoWindow::setVideoFrame);
}
static const float g_quad[] = {