[code] A:=new TA(); Echo "Set A to NIL\r\n"; A:=nil; Echo "Run end\r\n"; Type TA=class FB; Public Function Create(); Begin FB:=new TB(self); end; Function Destroy(); Begin Echo "Destroy\r\n"; End; End; | type TB=class FOwner; Public function create(Owner); begin FOwner:=MakeWeakRef(Owner); end; end; [/code] 打印结果: Set A to NIL Destroy Run end |
![]() |