diff --git a/lib/yoga/src/main/cpp/yoga/Yoga.cpp b/lib/yoga/src/main/cpp/yoga/Yoga.cpp index 6201efb0252..52a1d073387 100644 --- a/lib/yoga/src/main/cpp/yoga/Yoga.cpp +++ b/lib/yoga/src/main/cpp/yoga/Yoga.cpp @@ -226,6 +226,11 @@ YOGA_EXPORT YGNodeRef YGNodeClone(YGNodeRef oldNode) { } YOGA_EXPORT void YGNodeFree(const YGNodeRef node) { + Event::publish(node, {node->getConfig()}); + delete node; +} + +YOGA_EXPORT void YGNodeDetachAndFree(const YGNodeRef node) { if (YGNodeRef owner = node->getOwner()) { owner->removeChild(node); node->setOwner(nullptr); diff --git a/lib/yoga/src/main/cpp/yoga/Yoga.h b/lib/yoga/src/main/cpp/yoga/Yoga.h index 9e9060b9b49..8c81c4b0051 100644 --- a/lib/yoga/src/main/cpp/yoga/Yoga.h +++ b/lib/yoga/src/main/cpp/yoga/Yoga.h @@ -58,6 +58,7 @@ WIN_EXPORT YGNodeRef YGNodeNew(void); WIN_EXPORT YGNodeRef YGNodeNewWithConfig(YGConfigRef config); WIN_EXPORT YGNodeRef YGNodeClone(YGNodeRef node); WIN_EXPORT void YGNodeFree(YGNodeRef node); +WIN_EXPORT void YGNodeDeatchAndFree(YGNodeRef node); WIN_EXPORT void YGNodeFreeRecursiveWithCleanupFunc( YGNodeRef node, YGNodeCleanupFunc cleanup);