summaryrefslogtreecommitdiffstats
path: root/logic/lists/JavaVersionList.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-22 23:05:18 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-22 23:05:18 +0100
commit3841260ef1f4e6d7e30e68d1ccae09bfbf176ceb (patch)
treeeec7d03361f180a953ac4d2000d6b7b4e6a19c75 /logic/lists/JavaVersionList.cpp
parent42bc02dc8af3f9791bce1b797cbe78d6d2c66040 (diff)
downloadMultiMC-3841260ef1f4e6d7e30e68d1ccae09bfbf176ceb.tar
MultiMC-3841260ef1f4e6d7e30e68d1ccae09bfbf176ceb.tar.gz
MultiMC-3841260ef1f4e6d7e30e68d1ccae09bfbf176ceb.tar.lz
MultiMC-3841260ef1f4e6d7e30e68d1ccae09bfbf176ceb.tar.xz
MultiMC-3841260ef1f4e6d7e30e68d1ccae09bfbf176ceb.zip
Fix Java checker leaving behind temporary jar files
Diffstat (limited to 'logic/lists/JavaVersionList.cpp')
-rw-r--r--logic/lists/JavaVersionList.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/logic/lists/JavaVersionList.cpp b/logic/lists/JavaVersionList.cpp
index d2f0972c..c2886c67 100644
--- a/logic/lists/JavaVersionList.cpp
+++ b/logic/lists/JavaVersionList.cpp
@@ -177,9 +177,9 @@ void JavaListLoadTask::executeTask()
JavaUtils ju;
QList<QString> candidate_paths = ju.FindJavaPaths();
- auto job = new JavaCheckerJob("Java detection");
- connect(job, SIGNAL(finished(QList<JavaCheckResult>)), this, SLOT(javaCheckerFinished(QList<JavaCheckResult>)));
- connect(job, SIGNAL(progress(int, int)), this, SLOT(checkerProgress(int, int)));
+ m_job = std::shared_ptr<JavaCheckerJob>(new JavaCheckerJob("Java detection"));
+ connect(m_job.get(), SIGNAL(finished(QList<JavaCheckResult>)), this, SLOT(javaCheckerFinished(QList<JavaCheckResult>)));
+ connect(m_job.get(), SIGNAL(progress(int, int)), this, SLOT(checkerProgress(int, int)));
QLOG_DEBUG() << "Probing the following Java paths: ";
for(QString candidate : candidate_paths)
@@ -188,10 +188,10 @@ void JavaListLoadTask::executeTask()
auto candidate_checker = new JavaChecker();
candidate_checker->path = candidate;
- job->addJavaCheckerAction(JavaCheckerPtr(candidate_checker));
+ m_job->addJavaCheckerAction(JavaCheckerPtr(candidate_checker));
}
- job->start();
+ m_job->start();
}
void JavaListLoadTask::checkerProgress(int current, int total)
@@ -203,6 +203,7 @@ void JavaListLoadTask::checkerProgress(int current, int total)
void JavaListLoadTask::javaCheckerFinished(QList<JavaCheckResult> results)
{
QList<JavaVersionPtr> candidates;
+ m_job.reset();
QLOG_DEBUG() << "Found the following valid Java installations:";
for(JavaCheckResult result : results)