From: "laclists" <[EMAIL PROTECTED]>
> I'm learning to develop for Palm using prc-tools and
> gcc. I've created a "normal" program, but when I load
> the first form I get three mem leaks from the emulator.
(snip)
> But I'm using neither MemPtrNew() nor MemHandleNew().
> I'm just loading the form using FrmGotoForm() in
> PilotMain(), setting a handler to the form with
> FrmSetEventHandler() in the ApplicationHandleEvent() and
> implementing a very simple handler which looks like this:
>
At first glance perhaps PalmOS isn't getting a chance to release
the memory it's allocated to handle the form.
> static Boolean frmSenhaHndEvt(EventPtr evt)
> {
> Boolean handled = false;
(snip)
> switch (evt->eType)
> {
(snip)
> default:
> handled = true;
>
The "handled = true;" seems like it'll give you trouble. Effectively
you're telling PalmOS "I've handled every other event you might
send this form" without actually doing anything. Since this is
likely to suppress any processing Palm OS would normally do
in response to the frmCloseEvent (such as release memory) it
could well be the source of your problem.
Chris Tutty
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/