#3964 - Attempt to fix crash when closing on Linux (Debian unstable)
This commit is contained in:
parent
daa6dd0a25
commit
1f3046f65d
@ -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)
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user