diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index e8b0687bb..7ea3b62d8 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -4597,7 +4597,7 @@ void GUI_App::start_sync_user_preset(bool with_progress_dlg) }); }; cancelFn = [this, dlg]() { - return dlg->WasCanceled(); + return m_is_closing || dlg->WasCanceled(); }; finishFn = [this, userid = m_agent->get_user_id(), dlg](bool ok) { CallAfter([=]{ @@ -4689,8 +4689,12 @@ void GUI_App::stop_sync_user_preset() return; enable_sync = false; - if (m_sync_update_thread.joinable()) - m_sync_update_thread.detach(); + if (m_sync_update_thread.joinable()) { + if (m_is_closing) + m_sync_update_thread.join(); + else + m_sync_update_thread.detach(); + } } void GUI_App::start_http_server()