From d907f1aa92dbd4500a18db2c2492491c34c66087 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. Pick-to: 6.6 6.5 Change-Id: I8419a28a9db5bb59f768ab5820dfaf593464d6d2 Reviewed-by: Andy Nichols --- 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 7008031e40..255209a9b0 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -8069,11 +8069,11 @@ QRhi::~QRhi() if (!d) return; + runCleanup(); + qDeleteAll(d->pendingDeleteResources); d->pendingDeleteResources.clear(); - runCleanup(); - d->destroy(); delete d; }