From 1daed063f3d6cb4500e23b731fd6fe0ac308ff4f Mon Sep 17 00:00:00 2001 From: simonla Date: Wed, 12 Oct 2022 08:09:34 -0700 Subject: [PATCH] Fix memory leak (#1167) Summary: image `root_child0` be removed by`YGNodeRemoveChild(root, root_child0);` so `YGNodeFreeRecursive(root);` can not free `root_child0` Pull Request resolved: https://github.com/facebook/yoga/pull/1167 Reviewed By: NickGerleman, cipolleschi Differential Revision: D40298891 Pulled By: motiz88 fbshipit-source-id: 251d3b3decfbd102372a7afeb2e95c907f96a980 --- tests/YGNodeChildTest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/YGNodeChildTest.cpp b/tests/YGNodeChildTest.cpp index 70273447..39ed22db 100644 --- a/tests/YGNodeChildTest.cpp +++ b/tests/YGNodeChildTest.cpp @@ -31,4 +31,5 @@ TEST(YogaTest, reset_layout_when_child_removed) { ASSERT_TRUE(YGFloatIsUndefined(YGNodeLayoutGetHeight(root_child0))); YGNodeFreeRecursive(root); + YGNodeFreeRecursive(root_child0); }