From 2ac19a9699e05fdaa52862e8e813c916bf8839e6 Mon Sep 17 00:00:00 2001 From: Vincenzo Calligaro Date: Wed, 31 Jan 2024 17:36:30 +0100 Subject: [PATCH] Toponaming shapeprotector Nullify() check (#12177) * Moved the check inside the Nullify() method. --------- Signed-off-by: CalligaroV --- src/Mod/Part/App/TopoShape.cpp | 4 +++- src/Mod/Part/App/TopoShape.h | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index 674ced35f2..dd19832eda 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -4042,9 +4042,11 @@ TopoShape &TopoShape::makeFace(const std::vector &shapes, const char return *this; } -TopoShape &TopoShape::makeRefine(const TopoShape &shape, const char *op, bool no_fail) { +TopoShape &TopoShape::makeRefine(const TopoShape &shape, const char *op, bool no_fail) +{ (void)op; _Shape.Nullify(); + if(shape.isNull()) { if(!no_fail) HANDLE_NULL_SHAPE; diff --git a/src/Mod/Part/App/TopoShape.h b/src/Mod/Part/App/TopoShape.h index 876b221e0e..c5fa8e6e35 100644 --- a/src/Mod/Part/App/TopoShape.h +++ b/src/Mod/Part/App/TopoShape.h @@ -1072,9 +1072,11 @@ private: void Nullify() { - _owner->resetElementMap(); - _owner->_cache.reset(); - _owner->_parentCache.reset(); + if (!this->IsNull()) { + _owner->resetElementMap(); + _owner->_cache.reset(); + _owner->_parentCache.reset(); + } } const TopLoc_Location& Location() const