Fix startup crash loading saved LAN printers

load_local_machines_from_config() iterated a reference to the live
m_local_machines map while erase_local_machine() erased from it for
printers without access rights, invalidating the range-for iterator
(use-after-free on ++it). Iterate a copy instead, as the code did
before commit 5028a5000e.
This commit is contained in:
SoftFever
2026-07-20 16:05:38 +08:00
parent c6f06ab600
commit 176bb6062f
+1 -1
View File
@@ -36,7 +36,7 @@ namespace Slic3r
AppConfig* config = GUI::wxGetApp().app_config;
if (!config)
return;
const auto& local_machines = config->get_local_machines();
const auto local_machines = config->get_local_machines();
for (auto& it : local_machines) {
const auto& m = it.second;
if (localMachineList.count(m.dev_id))