> From: Michael Morton [mailto:[EMAIL PROTECTED]]
> when you fill the list, you are "supposed" to leave the char**
> resident in memory until you exit the form or such, but if you
> delete it, the list still works properly.

Yikes!  This is a crash waiting to happen.  If the list still works, it's
only by accident because the memory you just freed happens to remain
unchanged at the same location.  But if that freed space gets stomped before
the next list redraw, you're in big trouble.

But I think POSE should alert you about accessing freed memory in this case.
Is this not happening?  (You have all POSE debug checks enabled, right?)

> does the list keep its own chunk to store the list?

Nope, the list stores only the _pointer_ you give it.  You are still the
owner of that memory and need to keep it valid during the entire time when
the OS may need to access it to draw the list.

Try this: right before freeing this chunk of memory, fill it with garbage
bytes, then see if the list still works.  (In fact this is a great debugging
technique in general.  If using C++, override the global new and delete
operators to wipe out the chunk on every allocation and deallocation.)

-slj-


-- 
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