So basically, you want to add a finalizer for JS component? Note that we already have a weak (post-mortem) finalization module for JS, hidden somewhere in mozilla-central. It's not meant to be used for performance critical code, and it provides no guarantees about cycles, but if this is necessary, I could rework it in something a bit faster/more robust.
Cheers, David On 3/20/14 1:25 AM, smaug wrote: > And we could add a flag to WrappedJS so that it would call some callback > when it is about > to go away. That would let cleanup of WeakPromise happen asap. > Basically keep a hashtable wrappedjs -> > objects_implementing_callback_interface_foo. > Then when adding an object to the hashtable, wrappedjs would get marked > with a flag, that > it should look at the hashtable when it is going away, and if there is > value in the hashtable, > call the foo. > > This cleanup mechanism could be used with weak observers and weak > listeners too. > > > -Olli > _______________________________________________ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform -- David Rajchenbach-Teller, PhD Performance Team, Mozilla _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform