Merge pull request #107 from Snapmaker/dev_crash_fixed_alves

fix the application exit and use un define data lead to crash bug
This commit is contained in:
Alves
2026-01-07 16:48:25 +08:00
committed by GitHub

View File

@@ -1330,7 +1330,10 @@ void GLCanvas3D::reset_volumes()
m_volumes.clear(); m_volumes.clear();
m_dirty = true; m_dirty = true;
_set_warning_notification(EWarning::ObjectOutside, false); if (wxGetApp.plater() && wxGetApp().plater()->get_notification_manager())
{
_set_warning_notification(EWarning::ObjectOutside, false);
}
} }
//BBS: get current plater's bounding box //BBS: get current plater's bounding box
@@ -9695,8 +9698,15 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
//BBS: this may happened when exit the app, plater is null //BBS: this may happened when exit the app, plater is null
if (!wxGetApp().plater()) if (!wxGetApp().plater())
return; return;
NotificationManager* notification_managerEx = wxGetApp().plater()->get_notification_manager();
auto& notification_manager = *wxGetApp().plater()->get_notification_manager(); auto& notification_manager = *wxGetApp().plater()->get_notification_manager();
if (!notification_managerEx)
{
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format("notification_manager is null");
return;
}
switch (error) switch (error)
{ {
case PLATER_WARNING: case PLATER_WARNING: