Salome HOME
Issue 396: removed constraint did not disappear in the viewer
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Sketch.cpp
index 67fd1be899f23b7c4835f135abe87ed7b749f1b7..624ac16ab6d48455065bc0c226959764e7b0483a 100644 (file)
@@ -133,7 +133,7 @@ std::shared_ptr<ModelAPI_Feature> SketchPlugin_Sketch::addFeature(std::string th
   return aNew;
 }
 
-void SketchPlugin_Sketch::removeFeature(ModelAPI_Feature* theFeature)
+void SketchPlugin_Sketch::removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature)
 {
   if (!data().get()) // sketch is already removed (case on undo of sketch), sync is not needed
     return;
@@ -143,7 +143,7 @@ void SketchPlugin_Sketch::removeFeature(ModelAPI_Feature* theFeature)
   bool aHasEmtpyFeature = false;
   for(; aSubIt != aLastIt && !isRemoved; aSubIt++) {
     std::shared_ptr<ModelAPI_Feature> aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(*aSubIt);
-    if (aFeature.get() != NULL && aFeature.get() == theFeature) {
+    if (aFeature.get() != NULL && aFeature == theFeature) {
       data()->reflist(SketchPlugin_Sketch::FEATURES_ID())->remove(aFeature);
       isRemoved = true;
     }