char *head; head = (char *) MemPtrNew(100); head = text->GetCharPtr(header);
you allocate 100 bytes; lets say it has a memory location 0x01000000. you then *replace* the value inside head with the value returned by the GetCharPtr() API, lets say it is 0x02000000. when you do:
MemPtrFree(head);
you should be doing:
MemPtrFree(0x01000000);
but, instead are doing:
MemPtrFree(0x02000000);
and, 0x020000000 is a pointer that wasn't allocated using MemPtrNew() which is why its giving you an error message. my guess is you want to allocate the memory, then copy it from the text object.
head = (char *) MemPtrNew(100); StrCopy(head, text->GetCharPtr(header));
maybe? -- // Aaron Ardiri -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
