Link to home
Start Free TrialLog in
Avatar of bor061297
bor061297

asked on

Freeing components

Do I have to close free all objects created with Free
before terminating application, or all of them are
automatically free-ed?
ASKER CERTIFIED SOLUTION
Avatar of mvz121697
mvz121697

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of d003303
d003303

just a little cosmetics, the owner is passed in the Create method. Also, if the owner is freed, all owned components are freed, too. This does not depend on the parent property.
Generally, all components on a form are owned by the form. If e.g. a label resists on a panel wich resists on a form, the owner property of all two components is the form. The parent of the label though is the panel, the parent of the panel is the form. And normally all forms are owned by the application and have no parents (except MDIChild wich has the MDIForm as a parent).

Slash/d003303
Avatar of bor061297

ASKER

If I create a BitMap with:

Bitmap := TBitMap.Create;

is it automatically freed when application ends?
And, who owns Bitmap created in this way