On Wed, Aug 10, 2016 at 10:04 AM, Tony Whyman <tony.why...@mccallumwhyman.com> wrote: > > ... > > Destroying FMyInterface in the destructor does not make a difference - > mainly because the TMyClass destructor is not being called anyway.
It should be called, but is not. Strange. I tried to change the code to not using Application, DoRun, etc but the result is same. On Wed, Aug 10, 2016 at 10:14 AM, Tony Whyman <tony.why...@mccallumwhyman.com> wrote:> the output is: > > ... > > Creating TDelegateClass > Creating TMyClass > Creating TDelegateClass > Destroying TDelegateClass > > so it is actually worse with both interfaces left dangling > > You get the same result with: > > TMyClass = class(TInterfacedObject, IMyInterface) > private > FMyInterface: IMyInterface; // class type > property MyInterface: IMyInterface > read FMyInterface implements IMyInterface; > public > constructor Create(obj: IMyInterface); << The change > destructor Destroy; override; > end; Yeah, I saw the same. I think this is a bug. I not for FPC 3.0. I'm using FPC 2.6. If no more answers, you should report this in Bugtrack. I use Interfaces a lot, but not the 'implements' feature. Best regards, Marcos Douglas _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal