From 3f362cdf9304afeed06081cd5abfcaf6aaabe19e Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 14 Mar 2014 15:15:26 +0100 Subject: Fix potential crash during shutdown for QQuickWindows The cleanup() function would deregister the render loop from all windows the render loop had seen, but the render loop doesn't see windows until the window gets a showEvent and for some implementations it was removed as a result of hideEvent. So add explicit tracking to QSGRenderLoop which is managed by QQuickWindow's constructor and destructor. With this, we no longer need the lists from the subclasses, so these functions are removed again. Change-Id: I05e5507ad57e23c80bacd99752654cc7d0890dc1 Reviewed-by: Paul Olav Tvete --- src/quick/scenegraph/qsgrenderloop_p.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/quick/scenegraph/qsgrenderloop_p.h') diff --git a/src/quick/scenegraph/qsgrenderloop_p.h b/src/quick/scenegraph/qsgrenderloop_p.h index 47b59992e2..4a22fd60e7 100644 --- a/src/quick/scenegraph/qsgrenderloop_p.h +++ b/src/quick/scenegraph/qsgrenderloop_p.h @@ -44,6 +44,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -78,7 +79,9 @@ public: virtual void releaseResources(QQuickWindow *window) = 0; - virtual QList windows() const = 0; + void addWindow(QQuickWindow *win) { m_windows.insert(win); } + void removeWindow(QQuickWindow *win) { m_windows.remove(win); } + QSet windows() const { return m_windows; } // ### make this less of a singleton static QSGRenderLoop *instance(); @@ -99,6 +102,8 @@ public Q_SLOTS: private: static QSGRenderLoop *s_instance; + + QSet m_windows; }; QT_END_NAMESPACE -- cgit v1.2.3