Inspection: catch exceptions in destructor

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

View File

@@ -111,13 +111,26 @@ ViewProviderInspection::ViewProviderInspection()
ViewProviderInspection::~ViewProviderInspection()
{
pcColorRoot->unref();
pcCoords->unref();
pcMatBinding->unref();
pcColorMat->unref();
deleteColorBar();
pcLinkRoot->unref();
pcPointStyle->unref();
try {
pcColorRoot->unref();
pcCoords->unref();
pcMatBinding->unref();
pcColorMat->unref();
pcLinkRoot->unref();
pcPointStyle->unref();
deleteColorBar();
}
catch (Base::Exception& e) {
Base::Console().DestructorError(
"ViewProviderInspection",
"ViewProviderInspection::deleteColorBar() threw an exception: %s\n",
e.what());
}
catch (...) {
Base::Console().DestructorError(
"ViewProviderInspection",
"ViewProviderInspection destructor threw an unknown exception");
}
}
void ViewProviderInspection::onChanged(const App::Property* prop)