Salome HOME
PAL8536. Add static methods to set initial value of a parameter
[modules/smesh.git] / src / SMESH_I / SMESH_Mesh_i.cxx
index 2f8c2c306efb24cbc88ad8970ad987afc5f6c146..0fa06e0406a730b5d69f0abafefbbff655b074ea 100644 (file)
@@ -76,7 +76,8 @@ SMESH_Mesh_i::SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
                            CORBA::Long studyId )
 : SALOME::GenericObj_i( thePOA )
 {
-  INFOS("SMESH_Mesh_i");
+  INFOS("SMESH_Mesh_i; this = "<<this);
+  _impl = NULL;
   _gen_i = gen_i;
   _id = myIdGenerator++;
   _studyId = studyId;
@@ -91,7 +92,7 @@ SMESH_Mesh_i::SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
 
 SMESH_Mesh_i::~SMESH_Mesh_i()
 {
-  INFOS("~SMESH_Mesh_i");
+  INFOS("~SMESH_Mesh_i; this = "<<this);
   map<int, SMESH::SMESH_GroupBase_ptr>::iterator it;
   for ( it = _mapGroups.begin(); it != _mapGroups.end(); it++ ) {
     SMESH_GroupBase_i* aGroup = dynamic_cast<SMESH_GroupBase_i*>( SMESH_Gen_i::GetServant( it->second ).in() );
@@ -262,6 +263,12 @@ int SMESH_Mesh_i::importMEDFile( const char* theFileName, const char* theMeshNam
   list<int> aGroupIds = _impl->GetGroupIds();
   for ( list<int>::iterator it = aGroupIds.begin(); it != aGroupIds.end(); it++ ) {
     SMESH_Group_i* aGroupImpl     = new SMESH_Group_i( SMESH_Gen_i::GetPOA(), this, *it );
+
+    // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i
+    SMESH_Gen_i::GetPOA()->activate_object( aGroupImpl );
+    aGroupImpl->Register();
+    // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i
+
     SMESH::SMESH_Group_var aGroup = SMESH::SMESH_Group::_narrow( aGroupImpl->_this() );
     _mapGroups[*it]               = SMESH::SMESH_Group::_duplicate( aGroup );