MCPcopy Index your code
hub / github.com/DaveGamble/cJSON / cJSON_Delete

Function cJSON_Delete

cJSON.c:253–276  ·  view source on GitHub ↗

Delete a cJSON structure. */

Source from the content-addressed store, hash-verified

251
252/* Delete a cJSON structure. */
253CJSON_PUBLIC(void) cJSON_Delete(cJSON *item)
254{
255 cJSON *next = NULL;
256 while (item != NULL)
257 {
258 next = item->next;
259 if (!(item->type & cJSON_IsReference) && (item->child != NULL))
260 {
261 cJSON_Delete(item->child);
262 }
263 if (!(item->type & cJSON_IsReference) && (item->valuestring != NULL))
264 {
265 global_hooks.deallocate(item->valuestring);
266 item->valuestring = NULL;
267 }
268 if (!(item->type & cJSON_StringIsConst) && (item->string != NULL))
269 {
270 global_hooks.deallocate(item->string);
271 item->string = NULL;
272 }
273 global_hooks.deallocate(item);
274 item = next;
275 }
276}
277
278/* get the decimal point character of the current locale */
279static unsigned char get_decimal_point(void)

Callers 15

overwrite_itemFunction · 0.85
apply_patchFunction · 0.85
merge_patchFunction · 0.85
generate_merge_patchFunction · 0.85
create_objectsFunction · 0.85
parse_arrayFunction · 0.85
parse_objectFunction · 0.85
cJSON_AddNullToObjectFunction · 0.85
cJSON_AddTrueToObjectFunction · 0.85
cJSON_AddFalseToObjectFunction · 0.85
cJSON_AddBoolToObjectFunction · 0.85

Calls

no outgoing calls

Tested by 15

create_objectsFunction · 0.68
json_pointer_testsFunction · 0.68
misc_testsFunction · 0.68
sort_testsFunction · 0.68
merge_testsFunction · 0.68
generate_merge_testsFunction · 0.68
test_apply_patchFunction · 0.68
test_generate_testFunction · 0.68
compare_from_stringFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…