diff options
author | Petr Mrázek <peterix@gmail.com> | 2019-04-07 23:59:04 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2019-04-07 23:59:04 +0200 |
commit | 70ed30f9e6b47fbfb3151078ca61a2bb419feccb (patch) | |
tree | 0849ab3776d3e716285f3186b4e8e21ee246ee21 /api/logic/launch | |
parent | 414946cad94affccddfa500056c6eeb967438643 (diff) | |
download | MultiMC-70ed30f9e6b47fbfb3151078ca61a2bb419feccb.tar MultiMC-70ed30f9e6b47fbfb3151078ca61a2bb419feccb.tar.gz MultiMC-70ed30f9e6b47fbfb3151078ca61a2bb419feccb.tar.lz MultiMC-70ed30f9e6b47fbfb3151078ca61a2bb419feccb.tar.xz MultiMC-70ed30f9e6b47fbfb3151078ca61a2bb419feccb.zip |
GH-2591 less std::shared_ptr and more shared_qobject_ptr
This eliminates some weird crashes.
Diffstat (limited to 'api/logic/launch')
-rw-r--r-- | api/logic/launch/LaunchTask.cpp | 8 | ||||
-rw-r--r-- | api/logic/launch/LaunchTask.h | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/api/logic/launch/LaunchTask.cpp b/api/logic/launch/LaunchTask.cpp index d39a9208..841b8363 100644 --- a/api/logic/launch/LaunchTask.cpp +++ b/api/logic/launch/LaunchTask.cpp @@ -33,9 +33,9 @@ void LaunchTask::init() m_instance->setRunning(true); } -std::shared_ptr<LaunchTask> LaunchTask::create(InstancePtr inst) +shared_qobject_ptr<LaunchTask> LaunchTask::create(InstancePtr inst) { - std::shared_ptr<LaunchTask> proc(new LaunchTask(inst)); + shared_qobject_ptr<LaunchTask> proc(new LaunchTask(inst)); proc->init(); return proc; } @@ -44,12 +44,12 @@ LaunchTask::LaunchTask(InstancePtr instance): m_instance(instance) { } -void LaunchTask::appendStep(std::shared_ptr<LaunchStep> step) +void LaunchTask::appendStep(shared_qobject_ptr<LaunchStep> step) { m_steps.append(step); } -void LaunchTask::prependStep(std::shared_ptr<LaunchStep> step) +void LaunchTask::prependStep(shared_qobject_ptr<LaunchStep> step) { m_steps.prepend(step); } diff --git a/api/logic/launch/LaunchTask.h b/api/logic/launch/LaunchTask.h index 4f6efe0a..ee04bd9a 100644 --- a/api/logic/launch/LaunchTask.h +++ b/api/logic/launch/LaunchTask.h @@ -45,11 +45,11 @@ public: }; public: /* methods */ - static std::shared_ptr<LaunchTask> create(InstancePtr inst); + static shared_qobject_ptr<LaunchTask> create(InstancePtr inst); virtual ~LaunchTask() {}; - void appendStep(std::shared_ptr<LaunchStep> step); - void prependStep(std::shared_ptr<LaunchStep> step); + void appendStep(shared_qobject_ptr<LaunchStep> step); + void prependStep(shared_qobject_ptr<LaunchStep> step); void setCensorFilter(QMap<QString, QString> filter); InstancePtr instance() @@ -117,7 +117,7 @@ private: /*methods */ protected: /* data */ InstancePtr m_instance; shared_qobject_ptr<LogModel> m_logModel; - QList <std::shared_ptr<LaunchStep>> m_steps; + QList <shared_qobject_ptr<LaunchStep>> m_steps; QMap<QString, QString> m_censorFilter; int currentStep = -1; State state = NotStarted; |