Salome HOME
22573: [CEA 1154] Regression on a blsurf mesh (crash on test_periodicity_LR_ONLY.py)
[modules/smesh.git] / src / SMESH / SMESH_subMesh.cxx
index 0d4e2d120877f027f7f48970005a25a6a6963d3b..6545ef40ceb6c2fc04b31c00609d4f325955103a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -2469,7 +2469,9 @@ void SMESH_subMesh::deleteOwnListeners()
   {
     if ( !_father->MeshExists( d->myMeshID ))
       continue;
-    if ( _father->GetId() == d->myMeshID && !_father->GetSubMeshContaining( d->mySubMeshID ))
+    if ( _father->GetId() == d->myMeshID &&
+         this->GetId()    != d->mySubMeshID &&
+         !_father->GetSubMeshContaining( d->mySubMeshID ))
       continue;
     d->mySubMesh->DeleteEventListener( d->myListener );
   }