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
2017-02-15 12:21:51 -08:00
committed by Facebook Github Bot
parent 5dc64b40a5
commit d768309367
3 changed files with 35 additions and 5 deletions

View File

@@ -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.