diff --git a/src/libslic3r/Technologies.hpp b/src/libslic3r/Technologies.hpp index c66cca8ea..8deed7502 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -44,19 +44,15 @@ // Enable fix for dragging mouse event handling for gizmobar #define ENABLE_GIZMO_TOOLBAR_DRAGGING_FIX (1 && ENABLE_2_2_0_FINAL) -//============ -// 2.3.0 techs -//============ -#define ENABLE_2_3_0 1 - -// Enable rendering of objects colored by facets' slope -#define ENABLE_SLOPE_RENDERING (1 && ENABLE_2_3_0) //=================== // 2.3.0.alpha1 techs //=================== #define ENABLE_2_3_0_ALPHA1 1 +// Enable rendering of objects colored by facets' slope +#define ENABLE_SLOPE_RENDERING (1 && ENABLE_2_3_0_ALPHA1) + // Moves GLCanvas3DManager from being a static member of _3DScene to be a normal member of GUI_App #define ENABLE_NON_STATIC_CANVAS_MANAGER (1 && ENABLE_2_3_0_ALPHA1) diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 437af6d53..6a1964506 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -214,6 +214,10 @@ void MainFrame::shutdown() // when closing the application using Command+Q, a mouse event is triggered after this lambda is completed, // causing a crash if (m_plater) m_plater->unbind_canvas_event_handlers(); + + // Cleanup of canvases' volumes needs to be done here or a crash may happen on some Linux Debian flavours + // see: https://github.com/prusa3d/PrusaSlicer/issues/3964 + if (m_plater) m_plater->reset_canvas_volumes(); #endif // ENABLE_NON_STATIC_CANVAS_MANAGER // Weird things happen as the Paint messages are floating around the windows being destructed. diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 880aa8223..34fa9e1ee 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1834,6 +1834,7 @@ struct Plater::priv GLCanvas3D* get_current_canvas3D(); #if ENABLE_NON_STATIC_CANVAS_MANAGER void unbind_canvas_event_handlers(); + void reset_canvas_volumes(); #endif // ENABLE_NON_STATIC_CANVAS_MANAGER bool init_view_toolbar(); @@ -4084,6 +4085,15 @@ void Plater::priv::unbind_canvas_event_handlers() if (preview != nullptr) preview->get_canvas3d()->unbind_event_handlers(); } + +void Plater::priv::reset_canvas_volumes() +{ + if (view3D != nullptr) + view3D->get_canvas3d()->reset_volumes(); + + if (preview != nullptr) + preview->get_canvas3d()->reset_volumes(); +} #endif // ENABLE_NON_STATIC_CANVAS_MANAGER bool Plater::priv::init_view_toolbar() @@ -5500,6 +5510,11 @@ void Plater::unbind_canvas_event_handlers() { p->unbind_canvas_event_handlers(); } + +void Plater::reset_canvas_volumes() +{ + p->reset_canvas_volumes(); +} #endif // ENABLE_NON_STATIC_CANVAS_MANAGER PrinterTechnology Plater::printer_technology() const diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index a1ce52389..efdaa75cc 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -262,6 +262,7 @@ public: void set_current_canvas_as_dirty(); #if ENABLE_NON_STATIC_CANVAS_MANAGER void unbind_canvas_event_handlers(); + void reset_canvas_volumes(); #endif // ENABLE_NON_STATIC_CANVAS_MANAGER PrinterTechnology printer_technology() const;