Serious bug in TInterfacedObject / IUnknown
Original Reporter info from Mantis: stocki
-
Reporter name: stocki
Original Reporter info from Mantis: stocki
- Reporter name: stocki
Description:
program Bug;
{$APPTYPE console}
uses
sysutils, classes;
type
TIntfFoo = class(TInterfacedObject, IUnknown)
public
destructor Destroy; override;
end;
destructor TIntfFoo.Destroy;
begin
writeln('-->Destroy: You should not see this in console!');
inherited;
end;
function Interf: IUnknown;
begin
Result := TIntfFoo.Create;
end;
{
Interfaced objects Destroy is called before procedure goes out of scope!
FPC:
-->Start -->Destroy: You should not see this in console! -->End
Delphi:
-->Start -->End }
begin
writeln('-->Start');
Interf;
writeln('-->End');
readln;
end.
Mantis conversion info:
- Mantis ID: 26602
- Version: 2.7.1
- Monitored by: » stocki (stocki)