summaryrefslogtreecommitdiffstats
path: root/api/logic
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-12-14 01:18:18 +0100
committerPetr Mrázek <peterix@gmail.com>2018-12-14 01:18:18 +0100
commit14bb666a207ee76cf302152aa03579a47ef32215 (patch)
treee9264fba3e9922df0ecc3b2847a19def169b67f1 /api/logic
parent075e173fbd90292706d4033fcb965a4e48b2da6f (diff)
downloadMultiMC-14bb666a207ee76cf302152aa03579a47ef32215.tar
MultiMC-14bb666a207ee76cf302152aa03579a47ef32215.tar.gz
MultiMC-14bb666a207ee76cf302152aa03579a47ef32215.tar.lz
MultiMC-14bb666a207ee76cf302152aa03579a47ef32215.tar.xz
MultiMC-14bb666a207ee76cf302152aa03579a47ef32215.zip
GH-2485 fix crash bug while creating instances
Diffstat (limited to 'api/logic')
-rw-r--r--api/logic/InstanceList.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/api/logic/InstanceList.cpp b/api/logic/InstanceList.cpp
index a3f2e487..993ae92d 100644
--- a/api/logic/InstanceList.cpp
+++ b/api/logic/InstanceList.cpp
@@ -718,7 +718,7 @@ public:
// FIXME/TODO: add ability to abort during instance commit retries
bool abort() override
{
- if(m_child)
+ if(m_child && m_child->canAbort())
{
return m_child->abort();
}
@@ -726,9 +726,9 @@ public:
}
bool canAbort() const override
{
- if(m_child)
+ if(m_child && m_child->canAbort())
{
- return m_child->canAbort();
+ return true;
}
return false;
}
@@ -746,7 +746,6 @@ protected:
private slots:
void childSucceded()
{
- m_child.reset();
unsigned sleepTime = backoff();
if(m_parent->commitStagedInstance(m_stagingPath, m_instanceName, m_groupName))
{
@@ -764,7 +763,6 @@ private slots:
}
void childFailed(const QString & reason)
{
- m_child.reset();
m_parent->destroyStagingPath(m_stagingPath);
emitFailed(reason);
}