title: Delphi: Is this code a correct procedure of nulling a pointer in FormClose?
body: <p>IDE: Delphi XE6.</p>
  
  <p>My main form creates another form and that form creates an instance of <code>TFormZoom</code>. All seems to work flawlessly.</p>
  
  <p>I just want to be sure my procedure of nulling a pointer in <code>FormClose</code> is not distorting some inner workings of Delphi.</p>
  
  <pre><code>procedure TFormZoom.FormClose(Sender: TObject; var Action: TCloseAction);
  begin
    Action := caFree;
  
    // if I did not set it to nil here, the next time I would create this form I would get
    // EAccessViolation, because my other code checks for this form &lt;&gt; nil ...
  
    FormZoom := nil;
  end;
  </code></pre>
  
  <p>I am now thinking about, whether this approach is good. I don't get any compilation, nor run-time errors, this question is just a technicality.</p>