>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?
>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.
-----Original Message-----
From: Richard Hartman <[EMAIL PROTECTED]>
Newsgroups: palm-dev-forum
To: Palm Developer Forum <[EMAIL PROTECTED]>
Date: Monday, April 17, 2000 8:03 PM
Subject: Re: Form Titles
>If you're just changing the data in the original
>title (getting the CharPtr & writing your new
>title to it -- being careful that your new title is
>no longer than the original one!) then you don't
>have to do anything. 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.
>
>--
>-Richard M. Hartman
>[EMAIL PROTECTED]
>
>186,000 mi/sec: not just a good idea, it's the LAW!
>
>
>Dave Lippincott wrote in message <8515@palm-dev-forum>...
>>
>>does anyone know for sure?
>>
>>-----Original Message-----
>>From: Tim Astle <[EMAIL PROTECTED]>
>>Newsgroups: palm-dev-forum
>>To: Palm Developer Forum <[EMAIL PROTECTED]>
>>Date: Monday, April 17, 2000 10:40 AM
>>Subject: Re: Form Titles
>>
>>
>>>I assume when you release your forms, it would also take care of your
>>>assigned variable. This post is similar to the news post from earlier
>>today
>>>entitled, "Fields driving me crazy"
>>>
>>>Anyone else have insights to this as well?
>>>
>>>--
>>>
>>>Tim Astle
>>>
>>>
>>>
>>>Dave Lippincott <[EMAIL PROTECTED]> wrote in message
>>>news:8513@palm-dev-forum...
>>>>
>>>> Do I need to free the memory associated to a CharPtr if its assigned to
>>>the
>>>> form title? Or does the form free the title memory for me?
>>>>
>>>> i.e.
>>>> CharPtr MyCharPtr;
>>>> FormPtr MyForm;
>>>>
>>>> MyForm = FrmInitForm(MyFormID);
>>>> MyCharPtr = MemPtrNew(StrLen("Some Title")+1);
>>>> StrCopy(MyCharPtr,"Some Title");
>>>> FrmSetTitle(MyForm,MyCharPtr);
>>>> FrmDoDialog(MyForm);
>>>>
>>>> MemPtrFree(MyCharPtr); // Does this need to be done?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>--
>>>For information on using the Palm Developer Forums, or to unsubscribe,
>>please see http://www.palm.com/devzone/mailinglists.html
>>>
>>>
>>
>>
>>
>
>
>
>--
>For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html