- unit DelegateTalkerImpl;
   -  
   - interface
   -  
   - {$MODE OBJFPC}
   -  
   - uses
   -  
   -     TalkerIntf;
   -  
   - type
   -  
   -     TDelegateTalker = class(TInterfacedObject, ITalker)
   -     private
   -         fActualTalker : ITalker;
   -     public
   -         constructor create(const talker : ITalker);
   -         destructor destroy(); override;
   -  
   -         property talker : ITalker read fActualTalker implements ITalker;
   -     end;
   -  
   - implementation
   -  
   -     constructor TDelegateTalker.create(const talker : ITalker);
   -     begin
   -         fActualTalker := talker;
   -     end;
   -  
   -     destructor TDelegateTalker.destroy();
   -     begin
   -         fActualTalker := nil;
   -         inherited destroy();
   -     end;
   -  
   - end.
Above class, which employs interface delegation, cause memory leak. Detail how 
to reproduce can be read in
https://forum.lazarus.freepascal.org/index.php/topic,46575.0.html

or
Why is this interface delegation causing memory leak?

| 
| 
| 
|  |  |

 |

 |
| 
|  | 
Why is this interface delegation causing memory leak?

Suppose I have following codes Unit TalkerIntf.pas unit TalkerIntf; interface 
{$MODE OBJFPC} type ITal...
 |

 |

 |


Is this a bug as mentioned by David Heffernan?
Regards,

Fano Frameworkhttps://fanoframework.github.io
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to