[omniORB] OmniORB 2.8 and MFC

Guy Trudel gtrudel@mediatrix.com
Mon, 19 Jun 2000 09:47:33 -0400


You can ignore these messages since it's just singleton that are not deleted
at the end. But how can we know if all leaks messages are singleton and not
leaks that I introduced.

Here's something that I posted in january.
> I just test the new build with very simple test case, my plan is just to
use 
> this 'no leak' version in debug mode to detect my memory leaks.
This is still true, I was pushed in another(!!!) top-priority project (no
Corba at all), so my solution is not very tested.

Guy Trudel    

RE: [omniORB] omniORB memory leaks with MFC solved?
From: Guy Trudel (gtrudel@mediatrix.com)
Date: Fri Jan 07 2000 - 16:15:01 GMT 

----------------------------------------------------------------------------
----

It's not an omniorb with MFC leaks problem. It's just that some singleton 
are not deleted before program termination. I build an OmniOrb 2.8 that 
delete those singletons, calling orb::NP_destroy and 
omni_thread::init_t::releaseStatic() (or add the call of 
omni_thread::init_t::releaseStatic() to NP_destroy). 


I just test the new build with very simple test case, my plan is just to use

this 'no leak' version in debug mode to detect my memory leaks. 


It won't delete leaks in omniDynamic280_rt.dll if you use it. If you don't 
use TypeCode, Any, DynAny,etc you can compile without linking to 
omniDynamic280_rt(d).dll see <RE: [omniORB] solution for problems compiling 
projects using msdevstudio 6> 



Here's the diff: 


diff --recursive -u D:\OmniOrb2\omniORB_280/include/omnithread.h 
D:\noLeak_OmniOrb2\omniORB_280/include/omnithread.h 
--- D:\OmniOrb2\omniORB_280/include/omnithread.h Wed Dec 22 14:08:56 
1999 
+++ D:\noLeak_OmniOrb2\omniORB_280/include/omnithread.h Wed Dec 22 17:05:19 
1999 
@@ -508,6 +508,8 @@ 
         static int count; 
     public: 
         init_t(void); 
+ 
+ static void releaseStatic(void); 
     }; 
  
     friend class init_t; 



diff --recursive -u 
D:\OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/corbaOrb.cc 
D:\noLeak_OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/corbaOrb.cc 
--- D:\OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/corbaOrb.cc Wed 
Sep 22 21:21:46 1999 
+++ D:\noLeak_OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/corbaOrb.cc Thu 
Dec 23 12:45:45 1999 
@@ -419,6 +419,10 @@ 
  
   delete orb; 
   orb = 0; 
+ 
+ 
+ CORBA::string_free(omniORB::serverName); 
+ omni::myPrincipalID.replace(0, 0, NULL); 
 } 
  
 static 
diff --recursive -u 
D:\OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/objectRef.cc 
D:\noLeak_OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/objectRef.cc 
--- D:\OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/objectRef.cc Mon 
Aug 30 19:10:24 1999 
+++ D:\noLeak_OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/objectRef.cc 
Thu Dec 23 11:29:11 1999 
@@ -988,6 +988,10 @@ 
         p = next; 
       } 
     } 
+ 
+ delete omniObject::localObjectTable; 
+ delete omniObject::localPyObjectTable; 
+ delete omniObject::wrappedObjectTable; 
   } 
 }; 
  
diff --recursive -u 
D:\OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/ropeFactory.cc 
D:\noLeak_OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/ropeFactory.cc 
--- D:\OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/ropeFactory.cc Wed 
Sep 22 21:21:46 1999 
+++ D:\noLeak_OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/ropeFactory.cc 
Thu Dec 23 12:08:35 1999 
@@ -234,6 +234,16 @@ 
  
   void detach() { 
     StrandScavenger::removeRopeFactories(globalOutgoingRopeFactories); 
+ { 
+ ropeFactory_iterator iterator( globalOutgoingRopeFactories); 
+ delete iterator(); 
+ } 
+ 
+ 
+ delete 
omniORB::giopServerThreadWrapper::getGiopServerThreadWrapper(); 
+ delete globalOutgoingRopeFactories; 
+ 
+ tcpSocketFactoryType::deleteSingleton(); 
   } 
 }; 
  
diff --recursive -u 
D:\OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/tcpSocket.cc 
D:\noLeak_OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/tcpSocket.cc 
--- D:\OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/tcpSocket.cc Wed 
Sep 22 21:21:48 1999 
+++ D:\noLeak_OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/tcpSocket.cc 
Thu Dec 23 12:01:45 1999 
@@ -112,6 +112,12 @@ 
   } 
 } 
  
+void tcpSocketFactoryType::deleteSingleton() 
+{ 
+ delete singleton; 
+ singleton = 0; 
+} 
+ 
 tcpSocketFactoryType::tcpSocketFactoryType() 
 { 
 } 


diff --recursive -u 
D:\OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/tcpSocket.h 
D:\noLeak_OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/tcpSocket.h 
--- D:\OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/tcpSocket.h Wed 
Sep 22 21:21:48 1999 
+++ D:\noLeak_OmniOrb2\omniORB_280/src/lib/omniORB2/orbcore/tcpSocket.h Thu 
Dec 23 11:58:59 1999 
@@ -118,6 +118,8 @@ 
  
   friend class nobody; 
  
+ static void deleteSingleton(); 
+ 
 private: 
   tcpSocketFactoryType(); 
   ~tcpSocketFactoryType() {} // Cannot delete a factory type instance 


diff --recursive -u D:\OmniOrb2\omniORB_280/src/lib/omnithread/nt.cc 
D:\noLeak_OmniOrb2\omniORB_280/src/lib/omnithread/nt.cc 
--- D:\OmniOrb2\omniORB_280/src/lib/omnithread/nt.cc Thu Sep 23 21:10:24 
1999 
+++ D:\noLeak_OmniOrb2\omniORB_280/src/lib/omnithread/nt.cc Wed Dec 22 
17:06:25 1999 
@@ -417,6 +417,11 @@ 
 // 
 // Initialisation function (gets called before any user code). 
 // 
+void omni_thread::init_t::releaseStatic(void) 
+{ 
+ delete next_id_mutex; 
+ delete omni_thread::self(); 
+} 
  
 omni_thread::init_t::init_t(void) 
 { 




----------------------------------------------------------------------------
----

Next message: David Riddoch: "Re: [omniORB] Call Timeout" 
Previous message: Werner Nussbaumer: "[omniORB] OmniORB2 for IBM OS/390
UNIX???" 
Maybe in reply to: Mirko Benz: "[omniORB] omniORB memory leaks with MFC
solved?" 
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] 

----------------------------------------------------------------------------
----

This archive was generated by hypermail 2b29 : Tue Feb 01 2000 - 23:45:01
GMT 

> -----Original Message-----
> From: Robin Prninceley [mailto:robin@princeley.com]
> Sent: Thursday, June 15, 2000 10:32 PM
> To: omniorb-list@uk.research.att.com
> Subject: [omniORB] OmniORB 2.8 and MFC
> 
> 
> When using OmniORB with MFC, I get reports of memory leaks, 
> can I safely
> ignore these?
> 
> I'm not using the original binary dist., I've recompiled 
> omniORB with VC 6.0
> SP3 & April 2000 Platform SDK.
> 
> 
> Thanks,
> Robin Princeley