MCPcopy Index your code
hub / github.com/antirez/botlib / cJSON_Delete

Function cJSON_Delete

cJSON.c:253–274  ·  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 }
267 if (!(item->type & cJSON_StringIsConst) && (item->string != NULL))
268 {
269 global_hooks.deallocate(item->string);
270 }
271 global_hooks.deallocate(item);
272 item = next;
273 }
274}
275
276/* get the decimal point character of the current locale */
277static unsigned char get_decimal_point(void)

Callers 15

botGetUsernameFunction · 0.85
botSendMessageAndGetInfoFunction · 0.85
botGetFileFunction · 0.85
botProcessUpdatesFunction · 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

Calls

no outgoing calls

Tested by

no test coverage detected