From 45b81f180534b060177d379f1a2df9241288a449 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Tue, 1 Oct 2019 14:27:29 +0200 Subject: [PATCH] Fixed "unhandled unknown exception", when try to change an extruder count. Side effect after https://github.com/prusa3d/PrusaSlicer/commit/86b258f727212fde4cf4a7a5160bfe7d2b7e0972. --- src/slic3r/GUI/Tab.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 803a5cf08..d3f331442 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1808,7 +1808,10 @@ void TabPrinter::build_fff() optgroup->append_single_option_line("single_extruder_multi_material"); optgroup->m_on_change = [this, optgroup](t_config_option_key opt_key, boost::any value) { - size_t extruders_count = boost::any_cast(optgroup->get_value("extruders_count")); + // optgroup->get_value() return int for def.type == coInt, + // Thus, there should be boost::any_cast ! + // Otherwise, boost::any_cast causes an "unhandled unknown exception" + size_t extruders_count = size_t(boost::any_cast(optgroup->get_value("extruders_count"))); wxTheApp->CallAfter([this, opt_key, value, extruders_count]() { if (opt_key == "extruders_count" || opt_key == "single_extruder_multi_material") { extruders_count_changed(extruders_count);