From 4595ad68a915af50b04a502259a22719ee32b769 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 19 Jul 2023 11:19:28 +0200 Subject: [PATCH] rhi: Run cleanup callbacks before the pending deletes If a callback deleteLaters a QRhiResource that should still be handled and not left unreleased. Swap the order. Change-Id: I8419a28a9db5bb59f768ab5820dfaf593464d6d2 Reviewed-by: Andy Nichols (cherry picked from commit d907f1aa92dbd4500a18db2c2492491c34c66087) Reviewed-by: Qt Cherry-pick Bot --- src/gui/rhi/qrhi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index e299aaab7a1..294bcc6966a 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -7904,11 +7904,11 @@ QRhi::~QRhi() if (!d) return; + runCleanup(); + qDeleteAll(d->pendingDeleteResources); d->pendingDeleteResources.clear(); - runCleanup(); - d->destroy(); delete d; }