diff options
author | Jan Dalheimer <jan@dalheimer.de> | 2014-02-16 09:30:38 +0100 |
---|---|---|
committer | Jan Dalheimer <jan@dalheimer.de> | 2014-02-16 09:30:38 +0100 |
commit | 994972bf5da5584186e6e82c36287afeb6c1e23a (patch) | |
tree | d9a3705615f2e459958d612550cbf7b65874bf1d /logic | |
parent | 82b35b5445d88d67c89c6547b24053d31dc35b9c (diff) | |
download | MultiMC-994972bf5da5584186e6e82c36287afeb6c1e23a.tar MultiMC-994972bf5da5584186e6e82c36287afeb6c1e23a.tar.gz MultiMC-994972bf5da5584186e6e82c36287afeb6c1e23a.tar.lz MultiMC-994972bf5da5584186e6e82c36287afeb6c1e23a.tar.xz MultiMC-994972bf5da5584186e6e82c36287afeb6c1e23a.zip |
More fixes.
Diffstat (limited to 'logic')
-rw-r--r-- | logic/profiler/BaseProfiler.cpp | 4 | ||||
-rw-r--r-- | logic/profiler/JProfiler.cpp | 9 | ||||
-rw-r--r-- | logic/profiler/JVisualVM.cpp | 8 |
3 files changed, 16 insertions, 5 deletions
diff --git a/logic/profiler/BaseProfiler.cpp b/logic/profiler/BaseProfiler.cpp index 1a377818..b58e88be 100644 --- a/logic/profiler/BaseProfiler.cpp +++ b/logic/profiler/BaseProfiler.cpp @@ -21,7 +21,7 @@ void BaseProfiler::beginProfiling(MinecraftProcess *process) void BaseProfiler::abortProfiling() { - abortProfiling(); + abortProfilingImpl(); } void BaseProfiler::abortProfilingImpl() @@ -32,6 +32,8 @@ void BaseProfiler::abortProfilingImpl() } m_profilerProcess->terminate(); m_profilerProcess->deleteLater(); + m_profilerProcess = 0; + emit abortLaunch(tr("Profiler aborted")); } qint64 BaseProfiler::pid(QProcess *process) diff --git a/logic/profiler/JProfiler.cpp b/logic/profiler/JProfiler.cpp index 34f927ce..1cd8d128 100644 --- a/logic/profiler/JProfiler.cpp +++ b/logic/profiler/JProfiler.cpp @@ -26,13 +26,18 @@ void JProfiler::beginProfilingImpl(MinecraftProcess *process) static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), [this](int exit, QProcess::ExitStatus status) { - if (exit != 0 || status == QProcess::CrashExit) + if (status == QProcess::CrashExit) { emit abortLaunch(tr("Profiler aborted")); } - m_profilerProcess->deleteLater(); + if (m_profilerProcess) + { + m_profilerProcess->deleteLater(); + m_profilerProcess = 0; + } }); profiler->start(); + m_profilerProcess = profiler; } void JProfilerFactory::registerSettings(SettingsObject *settings) diff --git a/logic/profiler/JVisualVM.cpp b/logic/profiler/JVisualVM.cpp index 89098f73..c4bc851b 100644 --- a/logic/profiler/JVisualVM.cpp +++ b/logic/profiler/JVisualVM.cpp @@ -16,7 +16,7 @@ void JVisualVM::beginProfilingImpl(MinecraftProcess *process) { QProcess *profiler = new QProcess(this); profiler->setArguments(QStringList() << "--openpid" << QString::number(pid(process))); - profiler->setProgram("jvisualvm"); + profiler->setProgram(MMC->settings()->get("JVisualVMPath").toString()); connect(profiler, &QProcess::started, [this]() { emit readyToLaunch(tr("JVisualVM started")); }); connect(profiler, @@ -27,7 +27,11 @@ void JVisualVM::beginProfilingImpl(MinecraftProcess *process) { emit abortLaunch(tr("Profiler aborted")); } - m_profilerProcess->deleteLater(); + if (m_profilerProcess) + { + m_profilerProcess->deleteLater(); + m_profilerProcess = 0; + } }); profiler->start(); m_profilerProcess = profiler; |