[Part] Coverity: dtors can't throw

This commit is contained in:
Chris Hennes
2021-02-09 11:48:59 -06:00
committed by wwmayer
parent 1e2f8e366f
commit 46a899c437
4 changed files with 35 additions and 7 deletions

View File

@@ -2739,9 +2739,14 @@ void ViewProviderLink::dragMotionCallback(void *data, SoDragger *) {
}
void ViewProviderLink::updateLinks(ViewProvider *vp) {
auto ext = vp->getExtensionByType<ViewProviderLinkObserver>(true);
if(ext && ext->linkInfo)
ext->linkInfo->update();
try {
auto ext = vp->getExtensionByType<ViewProviderLinkObserver>(true);
if (ext && ext->linkInfo)
ext->linkInfo->update();
}
catch (const Base::TypeError &e) {
e.ReportException();
}
}
PyObject *ViewProviderLink::getPyObject() {

View File

@@ -178,7 +178,12 @@ DlgProjectionOnSurface::~DlgProjectionOnSurface()
delete ui;
for ( auto it : m_projectionSurfaceVec)
{
higlight_object(it.partFeature, it.partName, false, 0);
try {
higlight_object(it.partFeature, it.partName, false, 0);
}
catch (Standard_NoSuchObject& e) {
Base::Console().Warning("DlgProjectionOnSurface::~DlgProjectionOnSurface: %s", e.GetMessageString());
}
PartGui::ViewProviderPartExt* vp = dynamic_cast<PartGui::ViewProviderPartExt*>(Gui::Application::Instance->getViewProvider(it.partFeature));
if (vp)
{

View File

@@ -393,7 +393,13 @@ TaskCheckGeometryResults::TaskCheckGeometryResults(QWidget *parent) : QWidget(pa
TaskCheckGeometryResults::~TaskCheckGeometryResults()
{
Gui::Selection().clearSelection();
try {
Gui::Selection().clearSelection();
}
catch (const Py::Exception&) {
Base::PyException e; // extract the Python error text
e.ReportException();
}
}
void TaskCheckGeometryResults::setupInterface()

View File

@@ -522,7 +522,13 @@ PartGui::TaskMeasureLinear::TaskMeasureLinear()
PartGui::TaskMeasureLinear::~TaskMeasureLinear()
{
Gui::Selection().clearSelection();
try {
Gui::Selection().clearSelection();
}
catch (const Py::Exception&) {
Base::PyException e; // extract the Python error text
e.ReportException();
}
}
void PartGui::TaskMeasureLinear::onSelectionChanged(const Gui::SelectionChanges& msg)
@@ -1513,7 +1519,13 @@ PartGui::TaskMeasureAngular::TaskMeasureAngular()
PartGui::TaskMeasureAngular::~TaskMeasureAngular()
{
Gui::Selection().clearSelection();
try {
Gui::Selection().clearSelection();
}
catch (const Py::Exception&) {
Base::PyException e; // extract the Python error text
e.ReportException();
}
}
void PartGui::TaskMeasureAngular::onSelectionChanged(const Gui::SelectionChanges& msg)