diff options
author | Gunnar Sletta <[email protected]> | 2014-03-05 15:38:02 +0100 |
---|---|---|
committer | The Qt Project <[email protected]> | 2014-03-14 10:45:53 +0100 |
commit | 1656d6006bb797ad8489a0d8034f65d670895834 (patch) | |
tree | dfcc27d5930b4b83fc6eb6d7da117c1ec807057c /src/quick/scenegraph/qsgthreadedrenderloop.cpp | |
parent | 99308192510bbfd7c508a2aabcbef18445c61584 (diff) |
Make sure QSGRenderLoop is cleaned up cleanly.
e13547c595913c58e6bd6a5ed80fdc729fae7d47 used a global static to clean
up QSGRenderLoop which is triggered very late, potentially after
SG backend API plugins have been unloaded. This results in crashes
when used in combination with scenegraph-playgrounds's customcontext.
Partially revert the change and instead clean up at the time of
QApp::aboutToQuit and make sure we also disconnect cleanly from
all QQuickWindows.
This change also ensures that QSGRenderLoop::windowDestroyed() gets
called for all QQuickWindows registered with the render loop. This
ensures that rendering stops and that scene graph nodes and resources
will be cleaned up regardless of whether the application has
remembered to delete the window or not. This is a good thing as it
makes the scene graph shutdown a bit cleaner.
Change-Id: I9cb9093979f8eac05542f118a6ff9cfe5c84f745
Reviewed-by: Paul Olav Tvete <[email protected]>
Diffstat (limited to 'src/quick/scenegraph/qsgthreadedrenderloop.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index ba8c3a7fce..3dc2a50542 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -738,6 +738,14 @@ QSGThreadedRenderLoop::QSGThreadedRenderLoop() QSG_GUI_DEBUG((void *) 0, "QSGThreadedRenderLoop() created"); } +QList<QQuickWindow *> QSGThreadedRenderLoop::windows() const +{ + QList<QQuickWindow *> list; + foreach (const Window &w, m_windows) + list << w.window; + return list; +} + QSGRenderContext *QSGThreadedRenderLoop::createRenderContext(QSGContext *sg) const { return sg->createRenderContext(); |