From 384e0444379050b8672aef5b2b3453907fc4b542 Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Sun, 21 Jul 2024 17:25:43 -0700 Subject: [PATCH] QtUtils/ClearLayoutRecursively: Fix potential crash Use QObject->deleteLater() instead of the delete operator to destroy child widgets of the layout. This prevents crashes caused by pending events trying to access the now-destroyed widget. --- Source/Core/DolphinQt/QtUtils/ClearLayoutRecursively.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt/QtUtils/ClearLayoutRecursively.cpp b/Source/Core/DolphinQt/QtUtils/ClearLayoutRecursively.cpp index b7e588d01b..8869c8092d 100644 --- a/Source/Core/DolphinQt/QtUtils/ClearLayoutRecursively.cpp +++ b/Source/Core/DolphinQt/QtUtils/ClearLayoutRecursively.cpp @@ -17,7 +17,7 @@ void ClearLayoutRecursively(QLayout* layout) if (child->widget()) { layout->removeWidget(child->widget()); - delete child->widget(); + child->widget()->deleteLater(); } else if (child->layout()) {