From: mpv Date: Wed, 4 Feb 2015 07:30:32 +0000 (+0300) Subject: Issue #376 : one more crash-case fix X-Git-Tag: V_1.0.0~1^2~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c14ac19b5f9fe07bd7cde9a2659bbe6d063bf9b0;p=modules%2Fshaper.git Issue #376 : one more crash-case fix Sketch-Extrusion-One more sketch with something-Exit --- 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();