Ah ha text->GetCharPtr probably gave you a non freeable memory location. You are in fact not freeing the 100 bytes you allocated.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sruthi Sent: Thursday, February 08, 2007 2:03 PM To: Palm Developer Forum Subject: MemPtrFree Hi alll... I used a char poniter for holding a string. I have done this by first initializing the pointer memory with MemPtrNew. After the process i tried releasing the memory with MemPtrFree. After reaching the MemPtrFree point the application breaks with an error "MemoryMgr.c, Line:3675, Invalid chunk ptr". I am attaching the code segment with tis . Please go through it. char *head; head = (char *) MemPtrNew(100); head = text->GetCharPtr(header); WinSetTextColor(121); FntSetFont (stdFont); WinPaintChars(head,StrLen(head), (m_iScreenW >> 1)-((StrLen(head)*5)/2), yPOS ); MemPtrFree(head); Using "text->GetCharPtr(header)" a string is loaded into the pointer. Thanks in advance... -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
