Update CSSNodeFree for C#, Java and Objective-C
Reviewed By: emilsjolander Differential Revision: D4069655 fbshipit-source-id: 1fd764059784d7968af38b6aaf7fb6f70fdee8ee
This commit is contained in:
parent
3c5a7ae859
commit
31d3926784
|
@ -155,6 +155,17 @@ CSSNodeRef CSSNodeNew(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSSNodeFree(const CSSNodeRef node) {
|
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);
|
CSSNodeListFree(node->children);
|
||||||
free(node);
|
free(node);
|
||||||
gNodeInstanceCount--;
|
gNodeInstanceCount--;
|
||||||
|
|
Loading…
Reference in New Issue