Cleanup native view hierarchy when view is dropped.

Differential Revision: D2659738

fb-gh-sync-id: 1c14b8c3c6fabbd0e580777bb94221df6dd98f71
This commit is contained in:
Krzysztof Magiera
2015-11-16 14:27:57 -08:00
committed by facebook-github-bot-7
parent 0f590d1233
commit bd1885b5d4
6 changed files with 47 additions and 14 deletions

View File

@@ -406,9 +406,10 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
private void removeCSSNode(int tag) {
ReactShadowNode node = mShadowNodeRegistry.getNode(tag);
mShadowNodeRegistry.removeNode(tag);
for (int i = 0;i < node.getChildCount(); i++) {
for (int i = node.getChildCount() - 1; i >= 0; i--) {
removeCSSNode(node.getChildAt(i).getReactTag());
}
node.removeAllChildren();
}
/**