Correct way to free dynamically created UI compoent [duplicate]


This question already has an answer here:

How to free a component in Android / iOS

2 answers

When I create a UI Component in run time.

FLabel := TLabel.Create;
FLabel.Parent := Rectangle1;

My question is, how do I free this UI Component correctly.
How I do it at the moment, is by assign the parent prop to nil, and then free the ui component.

FLabel.Parent := nil;

My projects are running on Windows, Android & IOS.

Comments are closed.