phobosx.signal ready

Kagamin spam at here.lot
Sun Jul 28 09:39:30 PDT 2013


On Sunday, 21 July 2013 at 11:24:42 UTC, David wrote:
> "window.single_key_down[JUMP].strongConnect({ physics.jump(); 
> });"
> physics is a class variable, this will blow up once the class 
> holding it
> is gone

You ask for the weak ref semantics, but as the name suggests, 
strongConnect has the strong ref semantics. In this case the 
closure keep a strong ref to the object with the physics field 
and the signal keeps a strong ref to the closure, so the window 
keeps a strong ref to the object, so it won't be collected.


More information about the Digitalmars-d-announce mailing list