title: How to check if a instance was already freed in this case?
body: <p>In our application framework we have some kind of instance handler class that in resume it's responsible for capture the instances create by our others controllers/components/forms/etc. </p>
  
  <p>Here's the declaration:</p>
  
  <pre><code>TInstanceHandler = class(TFrameworkClass)
  strict private
    FInstances : TList&lt;TObject&gt;;
    procedure FreeInstances();
  protected
    procedure Initialize(); override;
    procedure Finalize(); override;
  public
    function Delegate&lt;T : class&gt;(const AInstance : T) : T;
  end;
  </code></pre>
  
  <p>And the implementation:</p>
  
  <pre><code>procedure TInstanceHandler.FreeInstances();
  var AInstance : TObject;
  begin
    for AInstance in FInstances do
      if(Assigned(AInstance)) then AInstance.Free();
    FInstances.Free();
  end; 
  
  procedure TInstanceHandler.Initialize();
  begin
    inherited;
    FInstances := TList&lt;TObject&gt;.Create();
  end;
  
  procedure TInstanceHandler.Finalize();
  begin
    FreeInstances();
    inherited;
  end;
  
  function TInstanceHandler.Delegate&lt;T&gt;(const AInstance : T) : T;
  begin
    FInstances.Add(AInstance);
  end;
  </code></pre>
  
  <p>what happen sometimes is that our programmers forgot the existence of this class or his purpose and they free their instances.</p>
  
  <p>Like this:</p>
  
  <pre><code>with InstanceHandler.Delegate(TStringList.Create()) do
    try
      //...
    finally
      Free();
    end;
  </code></pre>
  
  <p>what happens next is that when <code>TInstanceHandler</code> is finalized it will try to free the delegated instance again and this will lead to a error.
  I know the season why <code>Assigned</code> fail in this case and as far i can see i cant use <code>FreeAndNil</code>.</p>
  
  <p>so the question is: how i can correctly check if the reference was already freed?</p>