Re: [lazarus] Freeing runtime components.

2008-01-15 Thread Michael Van Canneyt


On Mon, 14 Jan 2008, Giuliano Colla wrote:

 Patrick Shepherd ha scritto:
  Sorry for such a simple question but I'm just getting back to programming
  (as a hobby).  Haven't done much since TP5.
  
  Anyway, if I create a component eg TPanel during runtime and set it's owner
  property to a form, do I have to write code to free the panel or is there
  already code in the forms destructor to free owned classes?
  
 AFAIK the form destructor takes care freeing all children components.

This is correct. Any owned components of a TComponent are freed when the
component is freed.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] Freeing runtime components.

2008-01-14 Thread Patrick Shepherd
Sorry for such a simple question but I'm just getting back to programming
(as a hobby).  Haven't done much since TP5.

Anyway, if I create a component eg TPanel during runtime and set it's owner
property to a form, do I have to write code to free the panel or is there
already code in the forms destructor to free owned classes?


_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Freeing runtime components.

2008-01-14 Thread Giuliano Colla

Patrick Shepherd ha scritto:

Sorry for such a simple question but I'm just getting back to programming
(as a hobby).  Haven't done much since TP5.

Anyway, if I create a component eg TPanel during runtime and set it's owner
property to a form, do I have to write code to free the panel or is there
already code in the forms destructor to free owned classes?


AFAIK the form destructor takes care freeing all children components.

Happy coding,

Giuliano


--
Giuliano Colla

Whenever people agree with me, I always feel I must be wrong (O. Wilde)

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives