在 Inno Setup Pascal 脚本中销毁对象

Destroy object in Inno Setup Pascal Script

如何销毁如下创建的对象。我可能需要根据对先前页面的回答更改页面:

[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;

在 Inno Setup Pascal 脚本中(在 Delphi/VCL 中),您通过调用对象的析构函数来销毁对象,其名称为 Free:

UninstallFirstPage.Free;

一个好的做法是之后重置变量值:

UninstallFirstPage := nil;