Hi, use Char nameP[8]=['\0','\0','\0','\0','\0','\0','\0','\0']; and close all forms in the stop application routine with FrmCloseAllForms(), generally make the leaks. -- Open WebMail Project (http://openwebmail.org)
---------- Original Message ----------- From: David Martin <[EMAIL PROTECTED]> To: "Palm Developer Forum" <[EMAIL PROTECTED]> Sent: Tue, 5 Aug 2003 06:32:06 -0700 (PDT) Subject: memory leak -- but where? > Greetings > > Here is a subroutine that does a frequently-wanted thing: it retrieves > the hotsync name. It also leaks "maxsize" bytes every time you call it. > > I thought I had goofed by not Unlocking something, but I have matching > MemHandleLock/MemHandleUnlock. what gives? > > thanks, > > David M > > /* parameter returns HotSync name */ > static void Get_PDAName( Char *pda, UInt16 maxsize ){ > MemHandle nameH; > Char *nameP = NULL; > > nameH = MemHandleNew(dlkMaxUserNameLength + 1); > nameP = MemHandleLock(nameH); > StrCopy(nameP, ""); > DlkGetSyncInfo(NULL, NULL, NULL, nameP, NULL, NULL); > StrNCopy( pda, nameP, maxsize - 1 ); > MemHandleUnlock(nameH); > } > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com > > -- > For information on using the Palm Developer Forums, or to unsubscribe, > please see http://www.palmos.com/dev/support/forums/ ------- End of Original Message ------- -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/