Fix for crash

This commit is contained in:
Filip Sykala - NTB T15p 2023-04-03 14:07:16 +02:00
parent 482b56f108
commit b9ac8aeafa

View file

@ -342,6 +342,13 @@ bool GLGizmoEmboss::init_create(ModelVolumeType volume_type)
BOOST_LOG_TRIVIAL(error) << "Can't create text. Gizmo is not activabled.";
return false;
}
// Check can't be inside is_activable() cause crash
// steps to reproduce: start App -> key 't' -> key 'delete'
if (wxGetApp().obj_list()->has_selected_cut_object()) {
BOOST_LOG_TRIVIAL(error) << "Can't create text on cut object";
return false;
}
m_style_manager.discard_style_changes();
@ -552,8 +559,7 @@ bool GLGizmoEmboss::on_init()
}
bool GLGizmoEmboss::on_is_activable() const {
return wxGetApp().get_mode() != comSimple &&
!wxGetApp().obj_list()->has_selected_cut_object();
return wxGetApp().get_mode() != comSimple;
}
std::string GLGizmoEmboss::on_get_name() const { return _u8L("Emboss"); }