True, having an array of handles would be easier on the OS's memory.
Like you wrote, I could even make it a dynamic array and resize it when
I need more or less memory.

However, there's another problem. This one relates to form refreshing (I
think). I kill all the handles in my form's close event (right after
FrmReturnToForm(Main)), everything is fine. 
But, if I were to quit my dialog form (which has all the fields) using
the "Application (Home)" silkscreened button, somehow, FrmReturnToForm
does not delete my dialog form, I kill the handles, and the OS gives me
a NULL handle error. I am fairly sure that the NULL handle is from my
field (the one I killed).
Any ideas?

Chris Tutty wrote:
> 
> <[EMAIL PROTECTED]> wrote
> > Right now I'm maintaining a linked-list to remember all the handles that
> > were created, each piece of the list taking an additional 96 bits (of
> > locked memory), I'm not being very memory efficient here.
> >
> Can you allocate an array of handles?  This needs a bit of code
> to manage it, but avoids the allocation overhead and heap fragmentation
> of a linked list.  Even if you don't know how many handles you'll need
> it's not hard to allocate a fixed block of, say, twenty handles and then
> resize the chunk by a fixed amount when you've used those handles.
> 
> This means that you can unlock and release the handles and then the
> array itself in response to the form close event.
> 
> Although I've got a sneaking suspicion that I'm forgetting something.
> 
> Chris Tutty

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

Reply via email to