Permalink
Browse files

Fix originalNode memory leak

Reviewed By: mdvacca

Differential Revision: D7608359

fbshipit-source-id: 7cf69f987d4c92202ea5794b76345cb1c685f881
  • Loading branch information...
ayc1 authored and facebook-github-bot committed Apr 16, 2018
1 parent 8621d4b commit 8102e35271ab68e0525a9c60d86a855bbeef9c1a
@@ -61,7 +61,7 @@ private void manageChildren(
}
enqueueUpdateProperties(newNode);
manageChildren(prevNode, prevNode.getChildrenList(), newNode.getChildrenList());
prevNode.setOriginalReactShadowNode(newNode);
newNode.setOriginalReactShadowNode(null);
}
int firstRemovedOrAddedViewIndex = sameReactTagIndex;
@@ -78,7 +78,7 @@ private void manageChildren(
viewsToAdd.add(new ViewAtIndex(newNode.getReactTag(), k));
List previousChildrenList = newNode.getOriginalReactShadowNode() == null ? null : newNode.getOriginalReactShadowNode().getChildrenList();
manageChildren(newNode, previousChildrenList, newNode.getChildrenList());
newNode.setOriginalReactShadowNode(newNode);
newNode.setOriginalReactShadowNode(null);
addedTags.add(newNode.getReactTag());
}
@@ -18,6 +18,7 @@
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableNativeMap;
import com.facebook.react.bridge.UIManager;
import com.facebook.react.common.annotations.VisibleForTesting;
import com.facebook.react.modules.i18nmanager.I18nUtil;
import com.facebook.react.uimanager.DisplayMetricsHolder;
import com.facebook.react.uimanager.NativeViewHierarchyManager;
@@ -95,7 +96,8 @@ public ReactShadowNode createNode(
}
}
private ReactShadowNode getRootNode(int rootTag) {
@VisibleForTesting
ReactShadowNode getRootNode(int rootTag) {
return mRootShadowNodeRegistry.getNode(rootTag);
}
@@ -11,7 +11,6 @@
import android.util.Log;
import com.facebook.infer.annotation.Assertions;
import com.facebook.react.uimanager.annotations.ReactPropertyHolder;
import com.facebook.yoga.YogaNodeCloneFunction;
import com.facebook.yoga.YogaAlign;
import com.facebook.yoga.YogaBaselineFunction;
import com.facebook.yoga.YogaConfig;
@@ -23,6 +22,7 @@
import com.facebook.yoga.YogaJustify;
import com.facebook.yoga.YogaMeasureFunction;
import com.facebook.yoga.YogaNode;
import com.facebook.yoga.YogaNodeCloneFunction;
import com.facebook.yoga.YogaOverflow;
import com.facebook.yoga.YogaPositionType;
import com.facebook.yoga.YogaValue;

0 comments on commit 8102e35

Please sign in to comment.