App: Prevent exceptions in destructors

Coverity issues 251332 and 356538. These destructors call methods
that could throw exceptions. Catch them and convert to console
print statements to prevent calls to `terminate()`.
This commit is contained in:
Chris Hennes
2025-03-22 21:44:17 -05:00
committed by Benjamin Nauck
parent a546517588
commit 867e4507cc
2 changed files with 10 additions and 2 deletions

View File

@@ -48,7 +48,11 @@ PropertyPythonObject::~PropertyPythonObject()
// this is needed because the release of the pickled object may need the
// GIL. Thus, we grab the GIL and replace the pickled with an empty object
Base::PyGILStateLocker lock;
this->object = Py::Object();
try {
this->object = Py::Object();
} catch (Py::TypeError &) {
Base::Console().Warning("Py::TypeError Exception caught while destroying PropertyPythonObject\n");
}
}
void PropertyPythonObject::setValue(const Py::Object& py)