Salome HOME
22261: EDF 2698 SMESH: Memory leak when displaying 2D quadratic elements as arcs
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ScaleDlg.cxx
index 859c5a7838fd6e672f716743953af926e9e2c40e..756255df38b23374d45ab4acbce8dd3ddeb6e2fa 100644 (file)
@@ -100,10 +100,6 @@ private:
 #define SPACING 6
 #define MARGIN  11
 
-//To disable automatic genericobj management, the following line should be commented.
-//Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx
-#define WITHGENERICOBJ
-
 //=================================================================================
 // class    : SMESHGUI_ScaleDlg()
 // purpose  :
@@ -536,12 +532,6 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
                                              aName.toLatin1().data());
            if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
              anEntryList.append( aSObject->GetID().c_str() );
-#ifdef WITHGENERICOBJ
-           // obj has been published in study. Its refcount has been incremented.
-           // It is safe to decrement its refcount
-           // so that it will be destroyed when the entry in study will be removed
-           mesh->UnRegister();
-#endif
          }
        }
        else {
@@ -551,12 +541,6 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
                                              LineEditNewMesh->text().toLatin1().data());
           if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
             anEntryList.append( aSObject->GetID().c_str() );
-#ifdef WITHGENERICOBJ
-          // obj has been published in study. Its refcount has been incremented.
-          // It is safe to decrement its refcount
-          // so that it will be destroyed when the entry in study will be removed
-          mesh->UnRegister();
-#endif
         }
         break;
       }
@@ -564,8 +548,10 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
     } catch (...) {
     }
 
-    for ( int i = 0; i < myMeshes.count(); i++ )
-      SMESH::Update( (SMESH::FindActorByObject( myMeshes[i] ))->getIO(), true );
+    for ( int i = 0; i < myObjects.count(); i++ ) {
+      SMESH_Actor* actor = SMESH::FindActorByObject( myObjects[i] );
+      if ( actor ) SMESH::Update( actor->getIO(), true );
+    }
 
     if ( ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) ||
          actionButton == MAKE_MESH_BUTTON ) {