]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CCAR: remove memory leaks
authorcaremoli <caremoli>
Wed, 16 Jan 2008 08:19:40 +0000 (08:19 +0000)
committercaremoli <caremoli>
Wed, 16 Jan 2008 08:19:40 +0000 (08:19 +0000)
src/NamingService/NamingService_WaitForServerReadiness.cxx
src/SALOMEDS/SALOMEDS.cxx
src/SALOMEDS/SALOMEDS_Driver_i.hxx
src/SALOMEDS/SALOMEDS_StudyManager_i.cxx

index 6d9d1f962f110b453d4e5f76b279326086c971f9..3021b6c857ca6e97aa489ada3096792c52d3456d 100644 (file)
@@ -66,8 +66,9 @@ void NamingService_WaitForServerReadiness(SALOME_NamingService* NS,
        {
          if (serverName.length() == 0)
            {
-             string dummyadr = NS->getIORaddr(); // to wait for naming service
+             char* dummyadr = NS->getIORaddr(); // to wait for naming service
              found = 1;
+              delete [] dummyadr;
              break; // naming service found
            }
          else
index e2646765cd08f36797f334a3df1a5393ad1307de..57c00c16f2dd83273167107e2495e47c59bb0e09 100644 (file)
@@ -136,6 +136,8 @@ SALOMEDS_EXPORT
     SALOMEDS_StudyManager_i * aStudyManager_i = new  SALOMEDS_StudyManager_i(orb, root_poa);
     // Activate the objects.  This tells the POA that the objects are ready to accept requests.
     PortableServer::ObjectId_var aStudyManager_iid =  root_poa->activate_object(aStudyManager_i);
+    //give ownership to the poa : the object will be deleted by the poa
+    aStudyManager_i->_remove_ref();
     aStudyManager_i->register_name("/myStudyManager");
   }
   return new SALOMEDS_StudyManager();
index 321b188cf05dc0b5904547d6b3ee67ea7b95d247..da3a87e2e081394ffb304ed5774e9173cfa56a77 100644 (file)
@@ -117,7 +117,7 @@ public:
 class SALOMEDS_DriverFactory_i : public virtual SALOMEDSImpl_DriverFactory 
 {
 protected:  
-  CORBA::ORB_ptr        _orb;
+  CORBA::ORB_var        _orb;
   SALOME_NamingService* _name_service;
 
 public:
index f06c882ba3a32cfee11065fcb46754cab9b7b4aa..7c5abcb944652f5d1509847e304d8e17661f039c 100644 (file)
@@ -87,6 +87,7 @@ SALOMEDS_StudyManager_i::~SALOMEDS_StudyManager_i()
 {
   // Destroy directory to register open studies
   _name_service->Destroy_Directory("/Study");
+  delete _name_service;
   delete _factory;
   delete _impl;
 }