summaryrefslogtreecommitdiffstats
path: root/application/MultiMC.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-05-01 01:27:10 +0200
committerPetr Mrázek <peterix@gmail.com>2017-05-01 01:27:10 +0200
commit21df531db1935f6b01411a729e3f45b634f6d9c9 (patch)
treee07c06ecc27b14aed70b18a6dd62bd2a3ae60fd2 /application/MultiMC.cpp
parentf06ac02396c8dfd002db80453963cb61bddce080 (diff)
downloadMultiMC-21df531db1935f6b01411a729e3f45b634f6d9c9.tar
MultiMC-21df531db1935f6b01411a729e3f45b634f6d9c9.tar.gz
MultiMC-21df531db1935f6b01411a729e3f45b634f6d9c9.tar.lz
MultiMC-21df531db1935f6b01411a729e3f45b634f6d9c9.tar.xz
MultiMC-21df531db1935f6b01411a729e3f45b634f6d9c9.zip
GH-1873 allow closing main window, fix window ref count
Diffstat (limited to 'application/MultiMC.cpp')
-rw-r--r--application/MultiMC.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp
index 85756069..bac81f8f 100644
--- a/application/MultiMC.cpp
+++ b/application/MultiMC.cpp
@@ -444,8 +444,6 @@ void MultiMC::performMainStartupAction()
auto inst = instances()->getInstanceById(m_instanceIdToLaunch);
if(inst)
{
- // minimized main window
- showMainWindow(true);
launch(inst, true, nullptr);
return;
}
@@ -1020,7 +1018,7 @@ void MultiMC::controllerSucceeded()
if(m_openWindows == 0 && m_runningInstances == 0)
{
m_status = Status::Succeeded;
- quit();
+ exit(0);
}
}
@@ -1041,7 +1039,7 @@ void MultiMC::controllerFailed(const QString& error)
if(m_openWindows == 0 && m_runningInstances == 0)
{
m_status = Status::Failed;
- quit();
+ exit(1);
}
}
@@ -1068,6 +1066,7 @@ MainWindow* MultiMC::showMainWindow(bool minimized)
}
m_mainWindow->checkInstancePathForProblems();
+ connect(m_mainWindow, &MainWindow::isClosing, this, &MultiMC::on_windowClose);
m_openWindows++;
}
// FIXME: move this somewhere else...
@@ -1157,9 +1156,9 @@ void MultiMC::on_windowClose()
m_mainWindow = nullptr;
}
// quit when there are no more windows.
- if(m_openWindows == 0)
+ if(m_openWindows == 0 && m_runningInstances == 0)
{
- quit();
+ exit(0);
}
}