DolphinQt/AchievementProgressWidget: Use ClearLayoutRecursively() to clear layout.

This commit is contained in:
Admiral H. Curtiss 2023-10-15 18:36:11 +02:00
parent bbf3fed93c
commit 3873664143
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
1 changed files with 2 additions and 6 deletions

View File

@ -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;