MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / cJSON_Delete

Function cJSON_Delete

external/cJSON/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

make_cjsonFunction · 0.85
parseFunction · 0.85
stringifyFunction · 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
cJSON_AddNumberToObjectFunction · 0.85
cJSON_AddStringToObjectFunction · 0.85

Calls 1

deallocateMethod · 0.45

Tested by

no test coverage detected