Forum > General

Carbage collection

(1/1)

User137:
Tried wiki search with words "freeing" "freed" "carbage" and same with forums come up with nothing useful so i need to ask about this "unknown" subject...

I have read that some objects may be freed automatically and question is what makes that happen? Does TForm free all object variables (for example TBitmap type) in public, private etc, does all classes free them? And what if i have same objects listed in another custom array and free them there, leaving class's variable not nil.

Leledumbo:
When a TComponent descendant is created, you supply one argument which is the Owner of the component. That Owner is responsible for freeing the component. Dropping a component (TButton, for instance) to a TForm automatically sets the button's owner to the form.

Navigation

[0] Message Index

Go to full version