Closed ajvincent closed 5 years ago
@erights Can you explain the memory leak to me again, please? The revokeEverything call revokes the proxies associated with a given ProxyMapping. Why is this insufficient?
Pushing to 0.10 for now: it doesn't seem to be an absolute blocker.
I should just end the debate by defining a singleton ProxyMapping.Dead = Symbol("dead proxy mapping"). Then revokeEverything can call Membrane.map.set(object, ProxyMapping.Dead), which will automatically break the last strong reference. For good measure, I can have Membrane.map.set(proxy, ProxyMapping.Dead) and Membrane.map.set(shadowTarget, ProxyMapping.Dead).
Deleting references in the WeakMap isn't good enough: that implies the possibility of allowing the Membrane to create new proxies.
proxiedFields[graphName] needs to go away during any proxy revocation.