mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-08 10:37:40 +00:00
fix: Slice all crash on a multi-plate project with an uninitialized toolbar (#15117)
_update_select_plate_toolbar_stats_item(true) runs from on_action_slice_all before the select-plate toolbar has necessarily been initialized. m_all_plates_stats_item is only assigned in _init_select_plate_toolbar, so slicing a multi-plate project shortly after startup (before the Preview tab has rendered) leaves the pointer null while show_stats_item is true, and the branch dereferences it, crashing with SIGSEGV. Every other dereference of this pointer already null-checks it. Add the same check here so the all-plates stats item is left unselected until the toolbar is initialized instead of crashing. Fixes #15116
This commit is contained in:
@@ -6977,7 +6977,7 @@ void GLCanvas3D::_update_select_plate_toolbar_stats_item(bool force_selected) {
|
||||
else
|
||||
m_sel_plate_toolbar.show_stats_item = false;
|
||||
|
||||
if (force_selected && m_sel_plate_toolbar.show_stats_item)
|
||||
if (force_selected && m_sel_plate_toolbar.show_stats_item && m_sel_plate_toolbar.m_all_plates_stats_item)
|
||||
m_sel_plate_toolbar.m_all_plates_stats_item->selected = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user