
2 Jan
2015
2 Jan
'15
7:57 p.m.
Suppose that each time I make a particular threepenny-gui widget, call it a `Foo`, I register an event handler using `on` so that the `Foo` can change its appearance based on some `Event`. Suppose I create, show, and hide a billion `Foo`s, each one never to be shown again. Can they be garbage collected? Presumably there is something storing the callback that was registered for the `Event` and the callback refers to the `Foo`. How then can the `Foo`s be freed? `Reactive.Threepenny.register` talks about an "unregister" action but says "FIXME: Unregistering event handlers does not work yet.". But how could it be known anyway when to unregister? Is there not the possibility of a space leak regardless? Thanks, Tom