From fdc58bb91360c04eed13a4fd4f8323a6a467dc37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 12 Nov 2013 09:23:39 +0100 Subject: Fix console not staying open on minecraft crash --- gui/ConsoleWindow.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gui/ConsoleWindow.cpp') diff --git a/gui/ConsoleWindow.cpp b/gui/ConsoleWindow.cpp index ec25b9cf..a3f294e6 100644 --- a/gui/ConsoleWindow.cpp +++ b/gui/ConsoleWindow.cpp @@ -122,14 +122,15 @@ void ConsoleWindow::on_btnKillMinecraft_clicked() ui->btnKillMinecraft->setEnabled(true); } -void ConsoleWindow::onEnded(BaseInstance *instance) +void ConsoleWindow::onEnded(BaseInstance* instance, int code, QProcess::ExitStatus status) { ui->btnKillMinecraft->setEnabled(false); - // TODO: Might need an option to forcefully close, even on an error if(instance->settings().get("AutoCloseConsole").toBool()) { - // TODO: Check why this doesn't work - if (!proc->exitCode()) this->close(); + if (code == 0 && status != QProcess::CrashExit) + { + this->close(); + } } } -- cgit v1.2.3