Actual fix of the rare crash recently mentioned in e547a0c

The problem was in fact elsewhere. After an object is added, it is necessary to
update the gizmos. GLGizmoManager::update_data needs to be called, but regardless
of whether any gizmo is currently opened (which is what is_running returns).

To reproduce the crash that this fixes: add an object, delete it, add another one,
open SLA gizmo -> crash
This commit is contained in:
Lukas Matena 2020-03-14 09:18:08 +01:00
parent 6b58f67fb8
commit ac103f334c

View File

@ -2527,9 +2527,8 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
selection.add_object((unsigned int)idx, false);
}
if (view3D->get_canvas3d()->get_gizmos_manager().is_running())
// this is required because the selected object changed and the flatten on face an sla support gizmos need to be updated accordingly
view3D->get_canvas3d()->update_gizmos_on_off_state();
// this is required because the selected object changed and the flatten on face an sla support gizmos need to be updated accordingly
view3D->get_canvas3d()->update_gizmos_on_off_state();
}
return obj_idxs;