From c14ac19b5f9fe07bd7cde9a2659bbe6d063bf9b0 Mon Sep 17 00:00:00 2001 From: mpv Date: Wed, 4 Feb 2015 10:30:32 +0300 Subject: [PATCH] Issue #376 : one more crash-case fix Sketch-Extrusion-One more sketch with something-Exit --- src/PartSet/PartSet_Module.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index d94e396a6..a7c92844e 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -196,11 +196,13 @@ bool PartSet_Module::canDisplayObject(const ObjectPtr& theObject) const if (aSketchFeature.get() != NULL) { FeaturePtr aFeature = ModelAPI_Feature::feature(theObject); - if (aFeature.get() != NULL) { + // MPV: the second and third conditions to avoid crash on exit for application + if (aFeature.get() != NULL && aFeature->data().get() && aFeature->data()->isValid()) { if (aFeature == aSketchFeature) { aCanDisplay = false; } - else { + else if (aSketchFeature.get() && aSketchFeature->data().get() && + aSketchFeature->data()->isValid()) { for (int i = 0; i < aSketchFeature->numberOfSubs() && !aCanDisplay; i++) { FeaturePtr aSubFeature = aSketchFeature->subFeature(i); std::list aResults = aSubFeature->results(); -- 2.39.2