[omniORB] Memory Leaks with omniORB 4.1.1 for VC8 and MFC

Martin Trappel 0xCDCDCDCD at gmx.at
Tue Jul 15 08:54:30 BST 2008


Martin Trappel wrote:
> Martin Trappel wrote:
>> Martin Trappel wrote:
>>> Greetings!
>>>
>>> I'm currently trying out omniORB 4.1.1.
>>> * omniORB-4.1.1-x86-win32-vc8.zip
>>> * Windows XP with Visual Stuido 2005 (VC8)
>>>
>>> I have run into this:
>>> When I compile the echo example with a VS2005 sample project (type: 
>>> Win32 console) with MFC support turned OFF, everything works fine.
>>>
>>> When I compile the echo example with a sample project where MFC is 
>>> turned ON, I get reported a lot of memory leaks, even if no omniORB 
>>> calls are done, but only echoSK.cc is compiled + linked with the 
>>> project.
>>>
>>> (...)
>>
>> OK, I just found out that memory leak detection is actually only 
>> available with MFC. That explains why I get no leaks reported with a 
>> simple win32 app. ::)
>>
>> Still, there remains the question: Are the reported leaks "real" leaks 
>> or is there some misreporting because of ... ?
>>
> 
> I have now confirmed that this is a problem of the MFC memory leak 
> detection.
> In short: The MFC memory leak detection will kick in before other 
> modules that do not use MFC have been unloaded, thereby reporting false 
> leaks.
> 

I thought I might update this old issue of mine since I was now able to 
find a solution for this ...

It's possible to switch the memory leak detection mechanism of MFC off, 
by providing a 2nd DLL with a static object and some clever calls.
See:
http://groups.google.com/group/microsoft.public.vc.mfc/msg/e651b944da9c619d
and
http://groups.google.com/group/microsoft.public.vc.mfc/browse_frm/thread/e40ffe3da9c06692/0fb3b0fdd6951f4f

br,
Martin



More information about the omniORB-list mailing list