Merge pull request #14723 from Dentomologist/resource_pack_manager_fix_crash_when_removing_pack

ResourcePackManager: Fix crash when removing pack and properly update list
This commit is contained in:
Admiral H. Curtiss
2026-07-14 19:26:15 +02:00
committed by GitHub
@@ -3,6 +3,8 @@
#include "DolphinQt/ResourcePackManager.h"
#include <string>
#include <QDesktopServices>
#include <QDialogButtonBox>
#include <QGridLayout>
@@ -15,6 +17,7 @@
#include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
#include "UICommon/ResourcePack/Manager.h"
#include "UICommon/ResourcePack/ResourcePack.h"
ResourcePackManager::ResourcePackManager(QWidget* widget) : QDialog(widget)
{
@@ -243,8 +246,12 @@ void ResourcePackManager::Remove()
if (box.exec() != QMessageBox::Yes)
return;
ResourcePack::ResourcePack& selected_pack =
ResourcePack::GetPacks()[GetResourcePackIndex(items[0])];
const std::string selected_pack_path = selected_pack.GetPath();
Uninstall();
File::Delete(ResourcePack::GetPacks()[GetResourcePackIndex(items[0])].GetPath());
ResourcePack::Remove(selected_pack);
File::Delete(selected_pack_path);
RepopulateTable();
}