blaze-react icon indicating copy to clipboard operation
blaze-react copied to clipboard

Correctly retain callbacks for event handlers

Open meiersi opened this issue 9 years ago • 2 comments

Currently, we create event handler callbacks using the AlwaysRetain flag, which is a memory leak. Ideally, we'd change ReactJS such that it exposes the list of live callbacks to us. Then, we could register them with the GHCJS GC and create the callbacks with a NoRetain flag.

meiersi avatar Sep 01 '14 19:09 meiersi

@meiersi Do you have a plan in place to implement this? If this will require coordination with the React devs, I'd love to get that ball rolling - I'd like to use this library for some work soon :).

cstrahan avatar Sep 14 '14 22:09 cstrahan

Hi @cstrahan, I was planning to first just fork ReactJS and see how I can expose their eventhandler references to an outside component. It shouldn't be too difficult, as they already use a central map to map react-id's back to event-handler closures. Once this works, I'd package up the work as a pull request to make sure the solution doesn't bitrot. However, I don't have concrete plans for when to work on this; i.e., if you need it soon, then you'll probably have to take a stab at it by yourself.

meiersi avatar Sep 15 '14 09:09 meiersi