]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #376 : one more crash-case fix
authormpv <mpv@opencascade.com>
Wed, 4 Feb 2015 07:30:32 +0000 (10:30 +0300)
committermpv <mpv@opencascade.com>
Wed, 4 Feb 2015 07:30:32 +0000 (10:30 +0300)
Sketch-Extrusion-One more sketch with something-Exit

src/PartSet/PartSet_Module.cpp

index d94e396a6e0cc5f07f361025a851af08daef5463..a7c92844e87a28c2e80f3ddc0da61dfec4ca279c 100644 (file)
@@ -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<ResultPtr> aResults = aSubFeature->results();