aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-12-05 21:33:42 +0100
committerSefa Eyeoglu <contact@scrumplex.net>2022-12-05 21:39:26 +0100
commit07359865c6aeeb70bcebcfb77e5f12430013de3c (patch)
treea7c5216cb7366b8ce4bf94395e3b28b0d6ca7425
parent2fd7338cd300de7ef86ccccb6fca89da7ec28e31 (diff)
downloadPrismLauncher-07359865c6aeeb70bcebcfb77e5f12430013de3c.tar.gz
PrismLauncher-07359865c6aeeb70bcebcfb77e5f12430013de3c.tar.bz2
PrismLauncher-07359865c6aeeb70bcebcfb77e5f12430013de3c.zip
fix: don't allocate BlockedsModsDialog
Fixes temporary memory leak! Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
-rw-r--r--launcher/modplatform/flame/FlameInstanceCreationTask.cpp6
-rw-r--r--launcher/modplatform/modpacksch/FTBPackInstallTask.cpp6
2 files changed, 7 insertions, 5 deletions
diff --git a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
index a00c948a..56d2273c 100644
--- a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
+++ b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
@@ -393,14 +393,14 @@ void FlameCreationTask::idResolverSucceeded(QEventLoop& loop)
if (anyBlocked) {
qWarning() << "Blocked mods found, displaying mod list";
- auto message_dialog = new BlockedModsDialog(m_parent, tr("Blocked mods found"),
+ BlockedModsDialog message_dialog(m_parent, tr("Blocked mods found"),
tr("The following files are not available for download in third party launchers.<br/>"
"You will need to manually download them and add them to the instance."),
blocked_mods);
- message_dialog->setModal(true);
+ message_dialog.setModal(true);
- if (message_dialog->exec()) {
+ if (message_dialog.exec()) {
qDebug() << "Post dialog blocked mods list: " << blocked_mods;
copyBlockedMods(blocked_mods);
setupDownloadJob(loop);
diff --git a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp
index 4c7b7a4f..7a6067f8 100644
--- a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp
+++ b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp
@@ -210,12 +210,14 @@ void PackInstallTask::onResolveModsSucceeded()
if (anyBlocked) {
qDebug() << "Blocked files found, displaying file list";
- auto message_dialog = new BlockedModsDialog(m_parent, tr("Blocked files found"),
+ BlockedModsDialog message_dialog(m_parent, tr("Blocked files found"),
tr("The following files are not available for download in third party launchers.<br/>"
"You will need to manually download them and add them to the instance."),
m_blocked_mods);
- if (message_dialog->exec() == QDialog::Accepted) {
+ message_dialog.setModal(true);
+
+ if (message_dialog.exec() == QDialog::Accepted) {
qDebug() << "Post dialog blocked mods list: " << m_blocked_mods;
createInstance();
} else {