MCPcopy Create free account
hub / github.com/acl-dev/acl / cJSON_Delete

Function cJSON_Delete

lib_acl/samples/json/json5/cJSON.cpp:81–93  ·  view source on GitHub ↗

Delete a cJSON structure. */

Source from the content-addressed store, hash-verified

79
80/* Delete a cJSON structure. */
81void cJSON_Delete(cJSON *c)
82{
83 cJSON *next;
84 while (c)
85 {
86 next=c->next;
87 if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child);
88 if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring);
89 if (!(c->type&cJSON_StringIsConst) && c->string) cJSON_free(c->string);
90 cJSON_free(c);
91 c=next;
92 }
93}
94
95/* Parse the input text to generate a number, and populate the result into item. */
96static const char *parse_number(cJSON *item,const char *num)

Callers 7

cJSON_ParseWithOptsFunction · 0.85
cJSON_ReplaceItemInArrayFunction · 0.85
cJSON_DuplicateFunction · 0.85
test_json_benchmarkFunction · 0.85
cjson_testFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_json_benchmarkFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…