diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index 75b9d6464b..356f1677d3 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -3731,7 +3731,11 @@ PropertyXLink::PropertyXLink(bool _allowPartial, PropertyLinkBase* parent) PropertyXLink::~PropertyXLink() { - unlink(); + try { + unlink(); + } catch (std::bad_weak_ptr &) { + FC_WARN("Bad pointer exception caught when destroying PropertyXLink\n"); + } } void PropertyXLink::setSyncSubObject(bool enable) diff --git a/src/App/PropertyPythonObject.cpp b/src/App/PropertyPythonObject.cpp index 4141c022d6..935abd69fd 100644 --- a/src/App/PropertyPythonObject.cpp +++ b/src/App/PropertyPythonObject.cpp @@ -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)