Fix memory leak that occurs when removing root nodes

Reviewed By: sriramramani

Differential Revision: D4540427

fbshipit-source-id: 8bdc0d2318371315b95300cdc6ca10bd0dbb55dd
This commit is contained in:
Andrew Y. Chen authored and Facebook Github Bot committed 2017-02-15 12:31:56 -08:00
1 parent 5dc64b40a5
commit d768309367
3 files changed
+35 -5

No files matched your search

@@ -133,10 +133,17 @@ public class UIImplementation {
* Unregisters a root node with a given tag.
*/
public void removeRootView(int rootViewTag) {
mShadowNodeRegistry.removeRootNode(rootViewTag);
removeRootShadowNode(rootViewTag);
mOperationsQueue.enqueueRemoveRootView(rootViewTag);
}
/**
* Unregisters a root node with a given tag from the shadow node registry
*/
public void removeRootShadowNode(int rootViewTag) {
mShadowNodeRegistry.removeRootNode(rootViewTag);
}
/**
* Invoked when native view that corresponds to a root node, or acts as a root view (ie. Modals)
* has its size changed.