myMeshServant( theMeshServant ),
myLocalID( theLocalID )
{
- thePOA->activate_object( this );
+ // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i,
+ // servant activation is performed by SMESH_Mesh_i::createGroup()
+ // thePOA->activate_object( this );
}
SMESH_Group_i::SMESH_Group_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i* theMeshServant, const int theLocalID )
-: SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
+ : SALOME::GenericObj_i( thePOA ),
+ SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
{
+ MESSAGE("SMESH_Group_i; this = "<<this );
}
SMESH_GroupOnGeom_i::SMESH_GroupOnGeom_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i* theMeshServant, const int theLocalID )
-: SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
+ : SALOME::GenericObj_i( thePOA ),
+ SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
{
+ MESSAGE("SMESH_GroupOnGeom_i; this = "<<this );
}
//=============================================================================
SMESH_GroupBase_i::~SMESH_GroupBase_i()
{
- MESSAGE("~SMESH_GroupBase_i;" );
+ MESSAGE("~SMESH_GroupBase_i; this = "<<this );
if ( myMeshServant )
myMeshServant->removeGroup(myLocalID);
}
// ======
class SMESH_Group_i:
- public SMESH_GroupBase_i,
public virtual POA_SMESH::SMESH_Group,
- public virtual SALOME::GenericObj_i
+ public SMESH_GroupBase_i
{
public:
SMESH_Group_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i* theMeshServant, const int theLocalID );
// =========================
class SMESH_GroupOnGeom_i:
- public SMESH_GroupBase_i,
public virtual POA_SMESH::SMESH_GroupOnGeom,
- public virtual SALOME::GenericObj_i
+ public SMESH_GroupBase_i
{
public:
SMESH_GroupOnGeom_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i* theMeshServant, const int theLocalID );
aGroupImpl = new SMESH_GroupOnGeom_i( SMESH_Gen_i::GetPOA(), this, anId );
else
aGroupImpl = new SMESH_Group_i( SMESH_Gen_i::GetPOA(), this, anId );
+
+ // 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
+
aGroup = SMESH::SMESH_GroupBase::_narrow( aGroupImpl->_this() );
_mapGroups[anId] = SMESH::SMESH_GroupBase::_duplicate( aGroup );