mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
Fix an error that AppConfig::save is called from non main thread
This commit is contained in:
@@ -146,7 +146,7 @@ void AppConfig::set_defaults()
|
|||||||
if (was_legacy && network_version.empty()) {
|
if (was_legacy && network_version.empty()) {
|
||||||
// User had legacy mode enabled - set to legacy version number
|
// User had legacy mode enabled - set to legacy version number
|
||||||
BOOST_LOG_TRIVIAL(info) << "Migrating legacy_networking=true to network_plugin_version=01.10.01.01";
|
BOOST_LOG_TRIVIAL(info) << "Migrating legacy_networking=true to network_plugin_version=01.10.01.01";
|
||||||
set("network_plugin_version", BAMBU_NETWORK_AGENT_VERSION_LEGACY);
|
set_network_plugin_version(BAMBU_NETWORK_AGENT_VERSION_LEGACY);
|
||||||
}
|
}
|
||||||
// Note: If was_legacy=false, we leave the version empty and let the GUI layer set it to the latest version
|
// Note: If was_legacy=false, we leave the version empty and let the GUI layer set it to the latest version
|
||||||
|
|
||||||
|
|||||||
@@ -1522,7 +1522,10 @@ int GUI_App::install_plugin(std::string name, std::string package_name, InstallP
|
|||||||
config_version = BBL::get_latest_network_version();
|
config_version = BBL::get_latest_network_version();
|
||||||
BOOST_LOG_TRIVIAL(info) << "[install_plugin] config_version was empty, using latest: " << config_version;
|
BOOST_LOG_TRIVIAL(info) << "[install_plugin] config_version was empty, using latest: " << config_version;
|
||||||
app_config->set_network_plugin_version(config_version);
|
app_config->set_network_plugin_version(config_version);
|
||||||
|
GUI::wxGetApp().CallAfter([this] {
|
||||||
|
if (app_config)
|
||||||
app_config->save();
|
app_config->save();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (!config_version.empty() && boost::filesystem::exists(legacy_lib_path)) {
|
if (!config_version.empty() && boost::filesystem::exists(legacy_lib_path)) {
|
||||||
#if defined(_MSC_VER) || defined(_WIN32)
|
#if defined(_MSC_VER) || defined(_WIN32)
|
||||||
|
|||||||
Reference in New Issue
Block a user