S
Shepherd
Unregistered / Unconfirmed
GUEST, unregistred user!
var
Intf: IInterface;
Form: TForm;
begin
Form:= TForm2.Create(nil);
Intf:= Form as IInterface;
ShowMessage(IntToStr(Intf._AddRef));
Intf:= nil;
Form.Free;
end;
打出来的结果是 -1
在不修改TComponent的情况下如何解决
Intf: IInterface;
Form: TForm;
begin
Form:= TForm2.Create(nil);
Intf:= Form as IInterface;
ShowMessage(IntToStr(Intf._AddRef));
Intf:= nil;
Form.Free;
end;
打出来的结果是 -1
在不修改TComponent的情况下如何解决