summaryrefslogtreecommitdiffstats
path: root/logic/profiler/JProfiler.cpp
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-02-16 08:54:52 +0100
committerJan Dalheimer <jan@dalheimer.de>2014-02-16 08:54:52 +0100
commit82b35b5445d88d67c89c6547b24053d31dc35b9c (patch)
tree333b6a40d558ab3022f7e68297f9b14863c854bc /logic/profiler/JProfiler.cpp
parent7ceb2cacb129d5924087f616cfc0b949689ed4fe (diff)
downloadMultiMC-82b35b5445d88d67c89c6547b24053d31dc35b9c.tar
MultiMC-82b35b5445d88d67c89c6547b24053d31dc35b9c.tar.gz
MultiMC-82b35b5445d88d67c89c6547b24053d31dc35b9c.tar.lz
MultiMC-82b35b5445d88d67c89c6547b24053d31dc35b9c.tar.xz
MultiMC-82b35b5445d88d67c89c6547b24053d31dc35b9c.zip
Fix stuff. Make sure different ways of aborting profiling work.
Diffstat (limited to 'logic/profiler/JProfiler.cpp')
-rw-r--r--logic/profiler/JProfiler.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/logic/profiler/JProfiler.cpp b/logic/profiler/JProfiler.cpp
index cec614ae..34f927ce 100644
--- a/logic/profiler/JProfiler.cpp
+++ b/logic/profiler/JProfiler.cpp
@@ -22,7 +22,16 @@ void JProfiler::beginProfilingImpl(MinecraftProcess *process)
.absoluteFilePath("bin/jpenable"));
connect(profiler, &QProcess::started, [this, port]()
{ emit readyToLaunch(tr("Listening on port: %1").arg(port)); });
- connect(profiler, SIGNAL(finished(int)), profiler, SLOT(deleteLater()));
+ connect(profiler,
+ static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
+ [this](int exit, QProcess::ExitStatus status)
+ {
+ if (exit != 0 || status == QProcess::CrashExit)
+ {
+ emit abortLaunch(tr("Profiler aborted"));
+ }
+ m_profilerProcess->deleteLater();
+ });
profiler->start();
}