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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user