You are unlocking, but not freeing your memory handle. Lookup MemHandleFree in the reference.
At 06:32 05/08/2003 -0700, you wrote:
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/
Ted Beisler SPRUCE Computer Systems, Inc. [EMAIL PROTECTED]
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/