What I'm trying to do is have a gadget display a number which I store in a TimeType variable as the gadget's data, then on drawing I take the numbers out of the TimeType variable and convert them to a string using StrIToA everything seems to work fine. But calling MemPtrFree does not actually free the memory. Here's the code I'm using minus code that actually does the drawing and manipulating the data.

char *string1;                  // string pointer def.

string1 = MemPtrNew(sizeof(char) * 7);  // allocating string pointer memory

StrIToA(string1, decimal); // decimal is minutes in decimal hours, works fine

// Clean up
if (string1)
{
        MemPtrFree(string1);
        string1 = NULL;
}

Other functions I call on the string are StrLen, FntCharsWidth, WinDrawChars.

This bug is really bad when I have several gadgets per form and they get redrawn several times when updating and memory is leaked like crazy.

Any help with what is causing my problem or a better solution would be greatly appreciated.

Jonathan Mason

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

Reply via email to