mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-11-12 16:50:37 +00:00
reformatting: cJSON_Delete
This commit is contained in:
1 parent
55488f66f6
commit
46cfa68a2b
1 file changed
+12
-3
@@ -112,9 +112,18 @@ void cJSON_Delete(cJSON *c)
|
|||||||
while (c)
|
while (c)
|
||||||
{
|
{
|
||||||
next = c->next;
|
next = c->next;
|
||||||
if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child);
|
if (!(c->type & cJSON_IsReference) && c->child)
|
||||||
if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring);
|
{
|
||||||
if (!(c->type&cJSON_StringIsConst) && c->string) cJSON_free(c->string);
|
cJSON_Delete(c->child);
|
||||||
|
}
|
||||||
|
if (!(c->type & cJSON_IsReference) && c->valuestring)
|
||||||
|
{
|
||||||
|
cJSON_free(c->valuestring);
|
||||||
|
}
|
||||||
|
if (!(c->type & cJSON_StringIsConst) && c->string)
|
||||||
|
{
|
||||||
|
cJSON_free(c->string);
|
||||||
|
}
|
||||||
cJSON_free(c);
|
cJSON_free(c);
|
||||||
c = next;
|
c = next;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user