user3161924
user3161924

Reputation: 2271

Destroy object in Inno Setup Pascal Script

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

Answers (1)

Martin Prikryl
Martin Prikryl

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

Related Questions