From 3873664143e5bac1559a70f5008a58ec7ed923bb Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Sun, 15 Oct 2023 18:36:11 +0200 Subject: [PATCH] DolphinQt/AchievementProgressWidget: Use ClearLayoutRecursively() to clear layout. --- .../DolphinQt/Achievements/AchievementProgressWidget.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Source/Core/DolphinQt/Achievements/AchievementProgressWidget.cpp b/Source/Core/DolphinQt/Achievements/AchievementProgressWidget.cpp index 636aa24709..0ae357895a 100644 --- a/Source/Core/DolphinQt/Achievements/AchievementProgressWidget.cpp +++ b/Source/Core/DolphinQt/Achievements/AchievementProgressWidget.cpp @@ -25,6 +25,7 @@ #include "Core/Core.h" #include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h" +#include "DolphinQt/QtUtils/ClearLayoutRecursively.h" #include "DolphinQt/QtUtils/ModalMessageBox.h" #include "DolphinQt/QtUtils/NonDefaultQPushButton.h" #include "DolphinQt/QtUtils/SignalBlocking.h" @@ -133,12 +134,7 @@ AchievementProgressWidget::CreateAchievementBox(const rc_api_achievement_definit void AchievementProgressWidget::UpdateData() { - QLayoutItem* item; - while ((item = m_common_layout->layout()->takeAt(0)) != nullptr) - { - delete item->widget(); - delete item; - } + ClearLayoutRecursively(m_common_layout); if (!AchievementManager::GetInstance()->IsGameLoaded()) return;