title: memory leak Tdelegated comparer
body: <p>I#m writing a generic graph lib in delphi .</p>
  
  <p>the code below shows implementation of TGraph and Tvertex</p>
  
  <pre><code>///  TGRAPH ....
  constructor TGraph&lt;Tdata&gt;.Create( ...);
  begin
    // the graph owns its vertices - by freeing of the graph one frees the vertex list!
    _vertices := TObjectList &lt; TVertex &lt; Tdata &gt;&gt;
      .Create(TVertex&lt;Tdata&gt;.createVertexComparer(), true);
  
    _edges := TObjectList &lt; TEdge &lt; Tdata &gt;&gt;
      .Create(TEdge&lt;Tdata&gt;.createEdgeComparer(), true); 
  end;
  
  // destroy the graph and all its elemenst!
  destructor TGraph&lt;Tdata&gt;.Free;
  
  begin
    _edges.Free;
    _vertices.Free;
  end;
  
  
  /// Tvertex ......
  class function TVertex&lt;T&gt;.createVertexComparer(): IComparer&lt;TVertex&lt;T&gt;&gt;;
  begin
    Result := TDelegatedComparer &lt; TVertex &lt; T &gt;&gt;.Create(
      function(const Left, Right: TVertex&lt;T&gt;): Integer
      begin
        Result := Left.Compare(Right);
      end);
  
  end;
  
  constructor TVertex&lt;T&gt;.Create(withID: Integer);
  begin
    F_neighbours := TObjectList &lt; TVertex &lt; T &gt;&gt;
      .Create(TVertex&lt;T&gt;.createVertexComparer(), true);
    vertex_id := withID;
  end;
  
  function TVertex&lt;T&gt;.Compare(const v: TVertex&lt;T&gt;): Integer;
  begin
    Result := (self.fId - v.vertex_id);
  end;
  
  destructor TVertex&lt;T&gt;.Free;
  begin
    F_neighbours.Free;
    // F_neighbours := nil;
    FreeAndNil(Fdata);
  end;
  </code></pre>
  
  <p>If I run the code i find a memory leak report with FastMM4 as shown in the screen dump.
  I can not understand why TdelegatedComparer is leaky ?</p>
  
  <p><img src="https://i.stack.imgur.com/IjPW2.png" alt="enter image description here"></p>