Skip to content

Commit

Permalink
Fix crash during project openning due to preset sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Noisyfox committed Mar 8, 2025
1 parent 4900c54 commit af8bdb1
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/slic3r/GUI/GUI_App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,17 +791,6 @@ void GUI_App::post_init()
if (! this->initialized())
throw Slic3r::RuntimeError("Calling post_init() while not yet initialized");

if (app_config->get("sync_user_preset") == "true") {
// BBS loading user preset
// Always async, not such startup step
// BOOST_LOG_TRIVIAL(info) << "Loading user presets...";
// scrn->SetText(_L("Loading user presets..."));
if (m_agent) { start_sync_user_preset(); }
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " sync_user_preset: true";
} else {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " sync_user_preset: false";
}

m_open_method = "double_click";
bool switch_to_3d = false;

Expand Down Expand Up @@ -957,6 +946,20 @@ void GUI_App::post_init()
}
}

// Start preset sync after project opened, otherwise we could have preset change during project opening which could cause crash
if (app_config->get("sync_user_preset") == "true") {
// BBS loading user preset
// Always async, not such startup step
// BOOST_LOG_TRIVIAL(info) << "Loading user presets...";
// scrn->SetText(_L("Loading user presets..."));
if (m_agent) {
start_sync_user_preset();
}
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " sync_user_preset: true";
} else {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " sync_user_preset: false";
}

// The extra CallAfter() is needed because of Mac, where this is the only way
// to popup a modal dialog on start without screwing combo boxes.
// This is ugly but I honestly found no better way to do it.
Expand Down

0 comments on commit af8bdb1

Please sign in to comment.