Re: How to get Interface reference counting in ATL
Tech-Archive recommends: Fix windows errors by optimizing your registry
In my stdafx.h, is use:
#ifdef _DEBUG
#define _ATL_DEBUG_INTERFACES //Define this macro before including any
ATL header files to trace all AddRef and Release calls on your
components' interfaces to the output window.
#endif
Jason Newell
Jaime Stuardo wrote:
Hi all..
For debug purposes I need to know if all interfaces I instantiate during
execution of my program are freed because I realized that some processes that
are run when I instantiate interfaces continue running after all interfaces
are released, so I have to identify what interface isn't being freed (I'm not
always using smart pointers).
Is there an API to get current reference counting for an interface?
By the way, I instantiating interfaces this way:
OO4O::OraDynaset * piDynaset = NULL;
m_piDatabase->GetCreateDynaset(T2COLE(lpszSQL),
0)->QueryInterface((OO4O::OraDynaset **)&piDynaset);
GetCreateDynaset method returns an IDispatchPtr.
I'm releasing that interface this way:
piDynaset->Release();
piDynaset = NULL;
Thanks
Jaime
.
Relevant Pages
- Re: How to get Interface reference counting in ATL
... 1.- I need to save the result in event log, since I need to test the application in production environment, not step by step. ... ATL header files to trace all AddRef and Release calls on your components' interfaces to the output window. ... For debug purposes I need to know if all interfaces I instantiate during execution of my program are freed because I realized that some processes that are run when I instantiate interfaces continue running after all interfaces ... (microsoft.public.vc.atl) - Re: DirectShow Crashes upon IMediaControl::Stop intermittently
... > before releasing the interfaces or call StopWhenReady? ... Another thing I recommend that you do is rewrite this using smart com ... (microsoft.public.win32.programmer.directx.video) - Re: How to unload all the resources of WMP?
... Try doing the following before releasing the interfaces. ... Please do not send email directly to this alias as this alias is for ... the memory can't be ... (microsoft.public.windowsmedia.sdk) - Is this the Right way TO release COM interface ?
... recently i have modified my source code to make more robust in exception ... My concern is avoiding Memory leaks or dangling interfaces. ... except double releasing i think there is no harm in this type of strategy .. ... (microsoft.public.vc.language) - Re: MS getting rid of dot net?
... >> problem with releasing such classes is that people will use them and so ... >> the framework will always have to support them. ... think having both delegates and interfaces is fine. ... (microsoft.public.dotnet.framework) |
|