From 176bb6062febad7c635911ba92fc147aa0b9cb03 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Mon, 20 Jul 2026 16:05:38 +0800 Subject: [PATCH] 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. --- src/slic3r/GUI/DeviceCore/DevManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/DeviceCore/DevManager.cpp b/src/slic3r/GUI/DeviceCore/DevManager.cpp index 4c338cf6cc..320d68f727 100644 --- a/src/slic3r/GUI/DeviceCore/DevManager.cpp +++ b/src/slic3r/GUI/DeviceCore/DevManager.cpp @@ -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))