Permalink
Browse files

Update CSSNodeFree for C#, Java and Objective-C

Reviewed By: emilsjolander

Differential Revision: D4069655

fbshipit-source-id: 1fd764059784d7968af38b6aaf7fb6f70fdee8ee
  • Loading branch information...
1 parent 3c5a7ae commit 31d392678421963733f90665586e9aa3172a0cf5 @splhack splhack committed with Facebook Github Bot Oct 25, 2016
Showing with 11 additions and 0 deletions.
  1. +11 −0 React/CSSLayout/CSSLayout.c
@@ -155,6 +155,17 @@ CSSNodeRef CSSNodeNew(void) {
}
void CSSNodeFree(const CSSNodeRef node) {
+ if (node->parent) {
+ CSSNodeListDelete(node->parent->children, node);
+ node->parent = NULL;
+ }
+
+ const uint32_t childCount = CSSNodeChildCount(node);
+ for (uint32_t i = 0; i < childCount; i++) {
+ const CSSNodeRef child = CSSNodeGetChild(node, i);
+ child->parent = NULL;
+ }
+
CSSNodeListFree(node->children);
free(node);
gNodeInstanceCount--;

0 comments on commit 31d3926

Please sign in to comment.