Dave Lippincott wrote in message <8673@palm-dev-forum>...
>
>>being careful that your new title is
>>no longer than the original one
>Are you sure about that? I don't have a title entered in constructor and
>all seems to be well after I change the form's title. It doesn't seem to
be
>leaking memory. If I try to free the memory after I'm done with the form,
I
>get an error. So it would seem that the form is releasing the memory. But
>is that true for all cases?
Copying more chars than the original title length would not result
in a memory leak. It would result in overwriting something else ...
whatever happens to be in memory following the original title.
What sort of effect this might have depends upon what was being
stored there.
>>If you are allocating new memory and setting that into the title (or
field)
>>then it is up to you to release it when you're done
>Thats not true for a field. If the field pointer is not NULL, the field
>will release the memory even if you dynamically allocated it.
Hmm... I was sure you were responsible for that. Well, you can
always -take- responsibility for it. You can always write your cleanup
routine to dissasociate your memory from the field and deallocate it
yourself. That way we don't have to guess what is going on. But if
you deallocate it, be sure to clear the association from the field so
nothing tries to access it afterwards!
--
-Richard M. Hartman
[EMAIL PROTECTED]
186,000 mi/sec: not just a good idea, it's the LAW!
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html