Delete functionality for shared childen

Summary:
@public

Removes `YGNodeInsertSharedChild` / `addSharedChildAt`.

This functionality is unused, and can cause memory leaks.

Reviewed By: SidharthGuglani

Differential Revision: D13711105

fbshipit-source-id: 86206c05393b3f1a497e6b046006f94ead88c6ce
This commit is contained in:
David Aurelio
2019-01-24 06:28:01 -08:00
committed by Facebook Github Bot
parent 8b8932811e
commit 5a9f29debb
5 changed files with 8 additions and 77 deletions

View File

@@ -402,20 +402,6 @@ void YGNodeInsertChild(
node->markDirtyAndPropogate();
}
void YGNodeInsertSharedChild(
const YGNodeRef node,
const YGNodeRef child,
const uint32_t index) {
YGAssertWithNode(
node,
node->getMeasure() == nullptr,
"Cannot add child: Nodes with measure functions cannot have children.");
node->insertChild(child, index);
child->setOwner(nullptr);
node->markDirtyAndPropogate();
}
void YGNodeRemoveChild(const YGNodeRef owner, const YGNodeRef excludedChild) {
// This algorithm is a forked variant from cloneChildrenIfNeeded in YGNode
// that excludes a child.

View File

@@ -69,16 +69,6 @@ WIN_EXPORT void YGNodeInsertChild(
const YGNodeRef child,
const uint32_t index);
// This function inserts the child YGNodeRef as a children of the node received
// by parameter and set the Owner of the child object to null. This function is
// expected to be called when using Yoga in persistent mode in order to share a
// YGNodeRef object as a child of two different Yoga trees. The child YGNodeRef
// is expected to be referenced from its original owner and from a clone of its
// original owner.
WIN_EXPORT void YGNodeInsertSharedChild(
const YGNodeRef node,
const YGNodeRef child,
const uint32_t index);
WIN_EXPORT void YGNodeRemoveChild(const YGNodeRef node, const YGNodeRef child);
WIN_EXPORT void YGNodeRemoveAllChildren(const YGNodeRef node);
WIN_EXPORT YGNodeRef YGNodeGetChild(const YGNodeRef node, const uint32_t index);