aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp')
-rw-r--r--src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
index 94bdf38819..2c05ce01c6 100644
--- a/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
+++ b/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
@@ -331,8 +331,12 @@ bool QSGD3D12RenderThread::event(QEvent *e)
qDebug("RT - WM_TryRelease - invalidating rc");
if (wme->window) {
QQuickWindowPrivate *wd = QQuickWindowPrivate::get(wme->window);
- if (wme->destroying)
+ if (wme->destroying) {
+ // QSGNode destruction may release graphics resources in use so wait first.
+ engine->waitGPU();
+ // Bye bye nodes...
wd->cleanupNodesOnShutdown();
+ }
rc->invalidate();
QCoreApplication::processEvents();
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);