summaryrefslogtreecommitdiffstats
path: root/src/quick3d/imports/scene3d/scene3drenderer_p.h
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2017-11-17 09:05:58 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2018-01-10 10:04:39 +0000
commit02d01a68971747f01a270226f6474190736939cf (patch)
treeb54f06580e8f960bb8518fe5f06b0e633846f5c6 /src/quick3d/imports/scene3d/scene3drenderer_p.h
parentc3b0c00041817bdb96aa33ee214b13c1b1ac9617 (diff)
Scene3DRenderer: ensure window pointer stays the same while renderingv5.9.4
It appears that the pointer value for the window could in some cases be updated meanwhile we were rendering, which resulted in random crashes. We now save the window pointer to a member variable on startup or whenever the windowChanged signal is fired and use a mutex to ensure the pointer won't change while we are rendering. This also covers the case where the item is destroyed but the cross-thread signals are not received before rendering happens. Task-number: QTBUG-63897 Task-number: QTBUG-65407 Change-Id: I5f2797e2210b532f9086ed186959fce27ea9f514 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/quick3d/imports/scene3d/scene3drenderer_p.h')
-rw-r--r--src/quick3d/imports/scene3d/scene3drenderer_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quick3d/imports/scene3d/scene3drenderer_p.h b/src/quick3d/imports/scene3d/scene3drenderer_p.h
index ab1db1010..7a85bc774 100644
--- a/src/quick3d/imports/scene3d/scene3drenderer_p.h
+++ b/src/quick3d/imports/scene3d/scene3drenderer_p.h
@@ -53,6 +53,7 @@
#include <QtCore/QObject>
#include <QtCore/qsize.h>
+#include <QtCore/QMutex>
QT_BEGIN_NAMESPACE
@@ -102,6 +103,8 @@ private:
QScopedPointer<QSGTexture> m_texture;
Scene3DSGNode *m_node; // Will be released by the QtQuick SceneGraph
Scene3DCleaner *m_cleaner;
+ QQuickWindow *m_window;
+ QMutex m_windowMutex;
QSize m_lastSize;
bool m_multisample;
bool m_lastMultisample;