summaryrefslogtreecommitdiffstats
path: root/api/logic
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-12-10 20:49:21 +0100
committerPetr Mrázek <peterix@gmail.com>2018-12-10 20:49:21 +0100
commitfb29e45bd0e8f4e696c4c71f43adb3fd9690d1d4 (patch)
tree4a9de7634feaae362a909fad0146998d2a9424ae /api/logic
parent3018310be3fa034ea4a980c82d7dd8119672d2de (diff)
downloadMultiMC-fb29e45bd0e8f4e696c4c71f43adb3fd9690d1d4.tar
MultiMC-fb29e45bd0e8f4e696c4c71f43adb3fd9690d1d4.tar.gz
MultiMC-fb29e45bd0e8f4e696c4c71f43adb3fd9690d1d4.tar.lz
MultiMC-fb29e45bd0e8f4e696c4c71f43adb3fd9690d1d4.tar.xz
MultiMC-fb29e45bd0e8f4e696c4c71f43adb3fd9690d1d4.zip
NOISSUE make instance creation task abortable
This may or may not expose issues when it actually IS used.
Diffstat (limited to 'api/logic')
-rw-r--r--api/logic/InstanceList.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/api/logic/InstanceList.cpp b/api/logic/InstanceList.cpp
index e568211b..a3f2e487 100644
--- a/api/logic/InstanceList.cpp
+++ b/api/logic/InstanceList.cpp
@@ -714,6 +714,25 @@ public:
virtual ~InstanceStaging() {};
+
+ // FIXME/TODO: add ability to abort during instance commit retries
+ bool abort() override
+ {
+ if(m_child)
+ {
+ return m_child->abort();
+ }
+ return false;
+ }
+ bool canAbort() const override
+ {
+ if(m_child)
+ {
+ return m_child->canAbort();
+ }
+ return false;
+ }
+
protected:
virtual void executeTask() override
{
@@ -727,6 +746,7 @@ protected:
private slots:
void childSucceded()
{
+ m_child.reset();
unsigned sleepTime = backoff();
if(m_parent->commitStagedInstance(m_stagingPath, m_instanceName, m_groupName))
{
@@ -744,6 +764,7 @@ private slots:
}
void childFailed(const QString & reason)
{
+ m_child.reset();
m_parent->destroyStagingPath(m_stagingPath);
emitFailed(reason);
}