I just fixed the bug in my sample Palm application that had be bothered
since Friday.  I had created a form with a list of strings built from a Palm
resource.  I set up the list in response to the frmOpenForm event and I was
freeing the memory when my form got a frmCloseForm event.  Although I was
acquiring memory and freeing it correctly, the emulator reported a memory
leak.  The problem was my event handler for frmCloseForm returned true,
telling the system the event had been handled.  Because of this, the event
never propogated into the system routines which actually deallocated the
form.  Returning false from the handler (after it freed my resource handle
and the handle to the array of char pointers) allowed the system to do its
thing -- no more leak.

So... would it be better for me to create my list and destroy it in response
to winEnterEvent and winExitEvent?  Then, my event handler could return true
without fouling the system.  My final application is going to contain five
or six different forms, so it may help memory usage to only create these
lists when the form is active.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to