Am 28.07.2013 18:39, schrieb Kagamin:
> 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.

Yeah I noticed that shortly after I wrote that... the "connect" method
should just work.

Reply via email to