[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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user