Could you have a look at code below. I got unfreed chunk of memory on exit of 
my app.
the code is called every time i download a new img. the m_videoHandle is closed 
and deleted in deconstructor of the class.

PalmPhotoDeleteImage returns an error here but it returns errNone in 
deconstructor.

the unfreed chunk size is 292;

/******************************************************/
//m_videoHandle is a PalmPhotoHanlde
if( m_videoHandle )
{
    PalmPhotoCloseImageV2( mImageLibRef, m_videoHandle );
    PalmPhotoDeleteImage( mImageLibRef, m_videoHandle ); 
    // above line returns an error everytime.
}
// this MemPtr points to a chunk of memory holding the jpeg image
MemPtr imgPtr;
CFile file( 0, "out.jpg", 'data', FILE_READWRITE );
file.Write( imgPtr, MemPtrSize( imgPtr ) );
file.Close();

UInt32 size = 0;
size = sizeof( PalmPhotoFileLocation );
PalmPhotoFileLocation * location = (PalmPhotoFileLocation *)MemPtrNew( size );
MemSet( location, sizeof( PalmPhotoFileLocation ), 0 );
memset( location->file.StreamFile.name, '\0', 32 );
const Char * n = "out.jpg";
memmove( location->file.StreamFile.name, n, strlen( n ) );
location->fileLocationType = palmPhotoStreamLocation;
location->file.StreamFile.type = 'data';
location->file.StreamFile.creator = APP_CREATOR_ID;
                
m_videoHandle = PalmPhotoOpenImageV2( mImageLibRef, location );
MemPtrFree( location );
/**************************************************/

Please help

thx thx so much
-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to