diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp index 942b1d93..42f0c93d 100644 --- a/application/MultiMC.cpp +++ b/application/MultiMC.cpp @@ -1001,7 +1001,8 @@ bool MultiMC::kill(InstancePtr instance) return false; } auto & extras = m_instanceExtras[instance->id()]; - auto & controller = extras.controller; + // NOTE: copy of the shared pointer keeps it alive + auto controller = extras.controller; if(controller) { return controller->abort(); diff --git a/application/MultiMC.h b/application/MultiMC.h index a9cbdec7..28a9641a 100644 --- a/application/MultiMC.h +++ b/application/MultiMC.h @@ -214,7 +214,7 @@ private: struct InstanceXtras { InstanceWindow * window = nullptr; - unique_qobject_ptr controller; + shared_qobject_ptr controller; }; std::map m_instanceExtras; size_t m_openWindows = 0;