[PD] Catch Python exceptions in dtors (Coverity)

In some PartDesign task dialogs, the destructors call functions that may
throw exceptions. If that occurs and the exception is uncaught, this
will ususally end up terminating the program. This commit adds try-catch
blocks around each instance of that (identified by Coverity) and handles
the Python exception in the normal reporting workflow.
This commit is contained in:
Chris Hennes
2021-02-08 13:13:03 -06:00
committed by wwmayer
parent ff85177c3f
commit 40c99417bd
6 changed files with 43 additions and 9 deletions

View File

@@ -485,7 +485,13 @@ void TaskMultiTransformParameters::apply()
TaskMultiTransformParameters::~TaskMultiTransformParameters()
{
closeSubTask();
try {
closeSubTask();
}
catch (const Py::Exception&) {
Base::PyException e; // extract the Python error text
e.ReportException();
}
if (proxy)
delete proxy;
}