Fem: catch exceptions in destructor

This commit is contained in:
Chris Hennes
2025-03-23 13:25:09 -05:00
committed by Benjamin Nauck
parent 67982f3963
commit ccbbe3d708

View File

@@ -261,27 +261,40 @@ ViewProviderFemPostObject::ViewProviderFemPostObject()
ViewProviderFemPostObject::~ViewProviderFemPostObject()
{
FemPostObjectSelectionObserver::instance().unregisterFemPostObject(this);
m_transpType->unref();
m_depthBuffer->unref();
m_shapeHints->unref();
m_coordinates->unref();
m_materialBinding->unref();
m_drawStyle->unref();
m_normalBinding->unref();
m_normals->unref();
m_faces->unref();
m_triangleStrips->unref();
m_markers->unref();
m_lines->unref();
m_sepMarkerLine->unref();
m_separator->unref();
m_material->unref();
m_matPlainEdges->unref();
m_switchMatEdges->unref();
deleteColorBar();
m_colorStyle->unref();
m_colorRoot->unref();
try {
FemPostObjectSelectionObserver::instance().unregisterFemPostObject(this);
m_transpType->unref();
m_depthBuffer->unref();
m_shapeHints->unref();
m_coordinates->unref();
m_materialBinding->unref();
m_drawStyle->unref();
m_normalBinding->unref();
m_normals->unref();
m_faces->unref();
m_triangleStrips->unref();
m_markers->unref();
m_lines->unref();
m_sepMarkerLine->unref();
m_separator->unref();
m_material->unref();
m_matPlainEdges->unref();
m_switchMatEdges->unref();
m_colorStyle->unref();
m_colorRoot->unref();
deleteColorBar();
}
catch (Base::Exception& e) {
Base::Console().DestructorError(
"ViewProviderFemPostObject",
"ViewProviderFemPostObject destructor threw an exception: %s\n",
e.what());
}
catch (...) {
Base::Console().DestructorError(
"ViewProviderFemPostObject",
"ViewProviderFemPostObject destructor threw an unknown exception");
}
}
void ViewProviderFemPostObject::deleteColorBar()