diff options
Diffstat (limited to 'logic/profiler/JVisualVM.cpp')
-rw-r--r-- | logic/profiler/JVisualVM.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/logic/profiler/JVisualVM.cpp b/logic/profiler/JVisualVM.cpp index 3850ff40..89098f73 100644 --- a/logic/profiler/JVisualVM.cpp +++ b/logic/profiler/JVisualVM.cpp @@ -19,8 +19,18 @@ void JVisualVM::beginProfilingImpl(MinecraftProcess *process) profiler->setProgram("jvisualvm"); connect(profiler, &QProcess::started, [this]() { emit readyToLaunch(tr("JVisualVM started")); }); - 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(); + m_profilerProcess = profiler; } void JVisualVMFactory::registerSettings(SettingsObject *settings) |