MCPcopy Create free account
hub / github.com/ByConity/ByConity / cJSON_Delete

Function cJSON_Delete

contrib/cJSON/cJSON.cpp:214–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212
213/* Delete a cJSON structure. */
214CJSON_PUBLIC(void) cJSON_Delete(cJSON *item)
215{
216 cJSON *next = NULL;
217 while (item != NULL)
218 {
219 next = item->next;
220 if (!(item->type & cJSON_IsReference) && (item->child != NULL))
221 {
222 cJSON_Delete(item->child);
223 }
224 if (!(item->type & cJSON_IsReference) && (item->valuestring != NULL))
225 {
226 global_hooks.deallocate(item->valuestring);
227 }
228 if (!(item->type & cJSON_StringIsConst) && (item->string != NULL))
229 {
230 global_hooks.deallocate(item->string);
231 }
232 global_hooks.deallocate(item);
233 item = next;
234 }
235}
236
237/* get the decimal point character of the current locale */
238static unsigned char get_decimal_point(void)

Callers 15

cJSON_ParseWithOptsFunction · 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
cJSON_AddRawToObjectFunction · 0.85
cJSON_AddObjectToObjectFunction · 0.85
cJSON_AddArrayToObjectFunction · 0.85

Calls 1

deallocateMethod · 0.45

Tested by

no test coverage detected