Topic: Weak attribute
Something I was lost
If I correctly understood, [WEAK] variable are such special variable (objects) which are nullified in case of a call somewhere. In this connection there is a separate manager of WEAK-references.
Soft links work either in NEXTGEN, or in the normal compiler, since Berlin.
What do I do not so?
type TMyClass = class public [Weak] F: TObject; end; procedure TForm1.FormCreate (Sender: TObject); var Instance: TMyClass; Obj: TObject; begin Instance: = TMyClass. Create; try Obj: = TObject. Create; try Instance. F: = Obj; finally Obj. Free; end; Caption: = Format (' 0x%p ', [Pointer (Instance. F)]);//here should be nil finally Instance. Free; end; end;