PDA

View Full Version : detected memory leaks!!



sunny
October 30, 2006, 15:31:39
Hi,
After installing the IC 3.0 I loaded the VC++6 sample Filter Inspector program and ran this program. This sample application executed well, but when I stopped debugging execution,it took memory leaks !!

//////////////// VC++6 messages are //////////////////////////////////////
UDSHL.DLL shutting down!
Detected memory leaks!
Dumping objects ->
{44} normal block at 0x00FD1D00, 33 bytes long.
Data: < C > 00 43 00 CD CD CD CD CD CD CD CD CD CD CD CD CD
{43} normal block at 0x00FD0050, 40 bytes long.
Data: < |O > 14 7C 4F 00 16 00 00 00 00 00 00 00 00 00 00 00
Object dump complete.
UDSHL.DLL shutting down!
///////////////////////////////////////////////////////////////////////////

Unfortunately every VC++6 sample program and my application had same results.
Is there a fix for this?


And I use below statements in my application.
.................................................. .
smart_com<IFrameFilter> m_pROIFilter = FilterLoader::createFilter( "ROI" );
m_pROIFilter->beginParamTransfer();
// Set a ROI
m_pROIFilter->setParameter( "Left", atoi(m_sX) );
m_pROIFilter->setParameter( "Top", atoi(m_sY) );
m_pROIFilter->setParameter( "Width", atoi(m_width) );
m_pROIFilter->setParameter( "Height", atoi(m_height) );
m_pROIFilter->endParamTransfer();

tFrameFilterList m_filterList;
m_filterList.push_back( m_pROIFilter.get() );
m_grabber.setDeviceFrameFilters( m_filterList );
..........................
I think m_pROIFilter may allocate memory spcae,but I can't find any API that can free m_pROIFilter .
Is there any API ?

I hope your quick answer.
Thanks!

Stefan Geissler
October 30, 2006, 17:38:37
Hello Sunny,

If you use IC 3.0 then you must call "DShowLib::RxitLibrary()" at the end of your program. For example in the "Demoapp" in "Demoapp.cpp" is the function call:


/////////////////////////////////////////////////////////////////////////////
// CDemoAppApp construction.

CDemoAppApp::CDemoAppApp()
{
atexit( DShowLib::ExitLibrary );
}
This makes sure, that the memory is cleaned after the program has ended.

sunny
November 3, 2006, 06:03:54
Thank you for kind answer.
But, my Application and other sample programs are continued memory leak when I inserted ' atexit( DShowLib::ExitLibrary )' in application class constructor.

Why?
Help me, please...

Stefan Geissler
November 3, 2006, 09:45:16
The filter can be freed if you set it simply to NULL.
m_pROIFilter = NULL;