Merge pull request #3019 from Trial97/task_parent
fixed double deletion for tasks
This commit is contained in:
commit
736ecf266d
56 changed files with 86 additions and 111 deletions
|
@ -44,8 +44,8 @@
|
|||
#include "FileSystem.h"
|
||||
#include "java/JavaUtils.h"
|
||||
|
||||
JavaChecker::JavaChecker(QString path, QString args, int minMem, int maxMem, int permGen, int id, QObject* parent)
|
||||
: Task(parent), m_path(path), m_args(args), m_minMem(minMem), m_maxMem(maxMem), m_permGen(permGen), m_id(id)
|
||||
JavaChecker::JavaChecker(QString path, QString args, int minMem, int maxMem, int permGen, int id)
|
||||
: Task(), m_path(path), m_args(args), m_minMem(minMem), m_maxMem(maxMem), m_permGen(permGen), m_id(id)
|
||||
{}
|
||||
|
||||
void JavaChecker::executeTask()
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
#include <QProcess>
|
||||
#include <QTimer>
|
||||
#include <memory>
|
||||
|
||||
#include "JavaVersion.h"
|
||||
#include "QObjectPtr.h"
|
||||
|
@ -26,7 +25,7 @@ class JavaChecker : public Task {
|
|||
enum class Validity { Errored, ReturnedInvalidData, Valid } validity = Validity::Errored;
|
||||
};
|
||||
|
||||
explicit JavaChecker(QString path, QString args, int minMem = 0, int maxMem = 0, int permGen = 0, int id = 0, QObject* parent = 0);
|
||||
explicit JavaChecker(QString path, QString args, int minMem = 0, int maxMem = 0, int permGen = 0, int id = 0);
|
||||
|
||||
signals:
|
||||
void checkFinished(const Result& result);
|
||||
|
|
|
@ -163,7 +163,7 @@ void JavaListLoadTask::executeTask()
|
|||
JavaUtils ju;
|
||||
QList<QString> candidate_paths = m_only_managed_versions ? getPrismJavaBundle() : ju.FindJavaPaths();
|
||||
|
||||
ConcurrentTask::Ptr job(new ConcurrentTask(this, "Java detection", APPLICATION->settings()->get("NumberOfConcurrentTasks").toInt()));
|
||||
ConcurrentTask::Ptr job(new ConcurrentTask("Java detection", APPLICATION->settings()->get("NumberOfConcurrentTasks").toInt()));
|
||||
m_job.reset(job);
|
||||
connect(m_job.get(), &Task::finished, this, &JavaListLoadTask::javaCheckerFinished);
|
||||
connect(m_job.get(), &Task::progress, this, &Task::setProgress);
|
||||
|
@ -171,7 +171,7 @@ void JavaListLoadTask::executeTask()
|
|||
qDebug() << "Probing the following Java paths: ";
|
||||
int id = 0;
|
||||
for (QString candidate : candidate_paths) {
|
||||
auto checker = new JavaChecker(candidate, "", 0, 0, 0, id, this);
|
||||
auto checker = new JavaChecker(candidate, "", 0, 0, 0, id);
|
||||
connect(checker, &JavaChecker::checkFinished, [this](const JavaChecker::Result& result) { m_results << result; });
|
||||
job->addTask(Task::Ptr(checker));
|
||||
id++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue