See below
On Jan 11, 2005, at 11:33 PM, Ben Combee wrote:
At 11:58 PM 1/11/2005, you wrote:
I have an "intermittent" memory leak.
I put data into Fields in my program in only one place, in a utility
routine. I have 14 fields in the program, on three of the seven
forms.
When I run it in POSE with gremlins, after about 7000 events, I get 4
memory leaks occuring in the routine which places the strings in the
Fields, even though the Fields have been populated perhaps hundreds
of times by then.
How, and why can this happen, and more importantly, how can I stop it?
Which ROM image are you using with POSE? Are you using a OS 4.1.2
debug ROM?
I am using 4.1.2 debug ROM
Memory leaks are only reported by POSE when the program exits.
FldFreeMemory will correctly deallocate a handle-based form, but it
won't free memory that's been set by FldSetTextPtr, something usually
only used for read-only fields.
The only place where I set these fields is in this routine. I do READ
the fields using FldGetTextPtr. Could this cause a problem? Also, in an
attempt to get rid of the leak, I added FldFreeMemory for each of the
fields on a form when I exit the form.
There's a known memory leak on some ROMs involving exiting a form when
a menu is open, IIRC. It's a leak in the information used to store
the insertion point. Those leaks weren't masked in any of the
released versions of POSE.
Could this cause the other memory leaks that I see, that seem to occur
in "system" routines such as Find and FrmLoad?
I don't see any other problems here. Perhaps something's corrupting
the field values somewhere else in your code?
I assume that the only way I could corrupt the values would be by
setting them, and this only occurs in this routine.
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/