Reputation: 2271
How do you destroy an object created like below. I may need to change pages depending on answer to prior pages:
[Code]
var
UninstallFirstPage: TNewNotebookPage;
procedure Whatever();
begin
UninstallFirstPage := TNewNotebookPage.Create(UninstallProgressForm);
UninstallFirstPage.Notebook := UninstallProgressForm.InnerNotebook;
UninstallFirstPage.Parent := UninstallProgressForm.InnerNotebook;
UninstallFirstPage.Align := alClient;
...
{ How do you destruct UninstallFirstPage - may want to change it after created }
end;
Upvotes: 1
Views: 96
Reputation: 202118
In Inno Setup Pascal Script (in Delphi/VCL), you destroy an object by calling its destructor, which has a name Free
:
UninstallFirstPage.Free;
A good practice is to reset the variable value afterwards:
UninstallFirstPage := nil;
Upvotes: 1