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:
committed by
Benjamin Nauck
parent
a546517588
commit
867e4507cc
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user