Update CSSNodeFree for C#, Java and Objective-C

Reviewed By: emilsjolander

Differential Revision: D4069655

fbshipit-source-id: 1fd764059784d7968af38b6aaf7fb6f70fdee8ee
This commit is contained in:
Kazuki Sakamoto 2016-10-25 07:38:06 -07:00 committed by Facebook Github Bot
parent 3c5a7ae859
commit 31d3926784
1 changed files with 11 additions and 0 deletions

View File

@ -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--;