Fix originalNode memory leak
Reviewed By: mdvacca Differential Revision: D7608359 fbshipit-source-id: 7cf69f987d4c92202ea5794b76345cb1c685f881
This commit is contained in:
parent
8621d4b797
commit
8102e35271
|
@ -61,7 +61,7 @@ public class FabricReconciler {
|
||||||
}
|
}
|
||||||
enqueueUpdateProperties(newNode);
|
enqueueUpdateProperties(newNode);
|
||||||
manageChildren(prevNode, prevNode.getChildrenList(), newNode.getChildrenList());
|
manageChildren(prevNode, prevNode.getChildrenList(), newNode.getChildrenList());
|
||||||
prevNode.setOriginalReactShadowNode(newNode);
|
newNode.setOriginalReactShadowNode(null);
|
||||||
}
|
}
|
||||||
int firstRemovedOrAddedViewIndex = sameReactTagIndex;
|
int firstRemovedOrAddedViewIndex = sameReactTagIndex;
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ public class FabricReconciler {
|
||||||
viewsToAdd.add(new ViewAtIndex(newNode.getReactTag(), k));
|
viewsToAdd.add(new ViewAtIndex(newNode.getReactTag(), k));
|
||||||
List previousChildrenList = newNode.getOriginalReactShadowNode() == null ? null : newNode.getOriginalReactShadowNode().getChildrenList();
|
List previousChildrenList = newNode.getOriginalReactShadowNode() == null ? null : newNode.getOriginalReactShadowNode().getChildrenList();
|
||||||
manageChildren(newNode, previousChildrenList, newNode.getChildrenList());
|
manageChildren(newNode, previousChildrenList, newNode.getChildrenList());
|
||||||
newNode.setOriginalReactShadowNode(newNode);
|
newNode.setOriginalReactShadowNode(null);
|
||||||
addedTags.add(newNode.getReactTag());
|
addedTags.add(newNode.getReactTag());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ import com.facebook.react.bridge.ReactApplicationContext;
|
||||||
import com.facebook.react.bridge.ReadableMap;
|
import com.facebook.react.bridge.ReadableMap;
|
||||||
import com.facebook.react.bridge.ReadableNativeMap;
|
import com.facebook.react.bridge.ReadableNativeMap;
|
||||||
import com.facebook.react.bridge.UIManager;
|
import com.facebook.react.bridge.UIManager;
|
||||||
|
import com.facebook.react.common.annotations.VisibleForTesting;
|
||||||
import com.facebook.react.modules.i18nmanager.I18nUtil;
|
import com.facebook.react.modules.i18nmanager.I18nUtil;
|
||||||
import com.facebook.react.uimanager.DisplayMetricsHolder;
|
import com.facebook.react.uimanager.DisplayMetricsHolder;
|
||||||
import com.facebook.react.uimanager.NativeViewHierarchyManager;
|
import com.facebook.react.uimanager.NativeViewHierarchyManager;
|
||||||
|
@ -95,7 +96,8 @@ public class FabricUIManager implements UIManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ReactShadowNode getRootNode(int rootTag) {
|
@VisibleForTesting
|
||||||
|
ReactShadowNode getRootNode(int rootTag) {
|
||||||
return mRootShadowNodeRegistry.getNode(rootTag);
|
return mRootShadowNodeRegistry.getNode(rootTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ import static java.lang.System.arraycopy;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import com.facebook.infer.annotation.Assertions;
|
import com.facebook.infer.annotation.Assertions;
|
||||||
import com.facebook.react.uimanager.annotations.ReactPropertyHolder;
|
import com.facebook.react.uimanager.annotations.ReactPropertyHolder;
|
||||||
import com.facebook.yoga.YogaNodeCloneFunction;
|
|
||||||
import com.facebook.yoga.YogaAlign;
|
import com.facebook.yoga.YogaAlign;
|
||||||
import com.facebook.yoga.YogaBaselineFunction;
|
import com.facebook.yoga.YogaBaselineFunction;
|
||||||
import com.facebook.yoga.YogaConfig;
|
import com.facebook.yoga.YogaConfig;
|
||||||
|
@ -23,6 +22,7 @@ import com.facebook.yoga.YogaFlexDirection;
|
||||||
import com.facebook.yoga.YogaJustify;
|
import com.facebook.yoga.YogaJustify;
|
||||||
import com.facebook.yoga.YogaMeasureFunction;
|
import com.facebook.yoga.YogaMeasureFunction;
|
||||||
import com.facebook.yoga.YogaNode;
|
import com.facebook.yoga.YogaNode;
|
||||||
|
import com.facebook.yoga.YogaNodeCloneFunction;
|
||||||
import com.facebook.yoga.YogaOverflow;
|
import com.facebook.yoga.YogaOverflow;
|
||||||
import com.facebook.yoga.YogaPositionType;
|
import com.facebook.yoga.YogaPositionType;
|
||||||
import com.facebook.yoga.YogaValue;
|
import com.facebook.yoga.YogaValue;
|
||||||
|
|
Loading…
Reference in New Issue