diff options
| -rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 8 | ||||
| -rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 319c98ef93..e2a2d458f1 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -384,13 +384,15 @@ void QSGGuiThreadRenderLoop::teardownGraphics() { for (auto it = m_windows.begin(), itEnd = m_windows.end(); it != itEnd; ++it) { if (it->rhi) { - QQuickWindowPrivate::get(it.key())->cleanupNodesOnShutdown(); + QQuickWindowPrivate *wd = QQuickWindowPrivate::get(it.key()); + wd->cleanupNodesOnShutdown(); if (it->rc) it->rc->invalidate(); releaseSwapchain(it.key()); if (it->ownRhi) QSGRhiSupport::instance()->destroyRhi(it->rhi, {}); it->rhi = nullptr; + wd->rhi = nullptr; } } } @@ -403,7 +405,8 @@ void QSGGuiThreadRenderLoop::handleDeviceLoss() if (!it->rhi || !it->rhi->isDeviceLost()) continue; - QQuickWindowPrivate::get(it.key())->cleanupNodesOnShutdown(); + QQuickWindowPrivate *wd = QQuickWindowPrivate::get(it.key()); + wd->cleanupNodesOnShutdown(); if (it->rc) it->rc->invalidate(); @@ -414,6 +417,7 @@ void QSGGuiThreadRenderLoop::handleDeviceLoss() if (it->ownRhi) QSGRhiSupport::instance()->destroyRhi(it->rhi, {}); it->rhi = nullptr; + wd->rhi = nullptr; } } diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 4094a9d15c..d0528ac7f3 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -598,6 +598,7 @@ void QSGRenderThread::teardownGraphics() if (ownRhi) QSGRhiSupport::instance()->destroyRhi(rhi, {}); rhi = nullptr; + wd->rhi = nullptr; } void QSGRenderThread::handleDeviceLoss() |
