Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread inherited
Fri, Feb 21 2014 8:59 AMPermanent Link

Matthew Jones

Where must I use "inherited" in constructors and destructors?

This has always been a bit of a pain to remember in Delphi, but I wonder what is
important in WebBuilder.

Is it important for a generic class to call the inherited Create and inherited
Destroy? If so, why?

Is it important for a TComponent or TControl descendant to call the inherited
Create / Destroy? If so, why?

I would like to understand fully so that I don't go leaking.

/Matthew Jones/
Mon, Feb 24 2014 4:22 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Where must I use "inherited" in constructors and destructors? >>

Anywhere you want.  Just be mindful of what is/isn't created/destroyed yet.

<< Is it important for a generic class to call the inherited Create and
inherited Destroy? If so, why? >>

No, but it's a good habit to keep.

<< Is it important for a TComponent or TControl descendant to call the
inherited Create / Destroy? If so, why? >>

Yes, those classes need to call Create/Destroy to manage ownership, etc.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Feb 25 2014 5:42 AMPermanent Link

Matthew Jones

Thanks.

/Matthew Jones/
Image