Delete a cJSON structure. */
| 262 | |
| 263 | /* Delete a cJSON structure. */ |
| 264 | CJSON_PUBLIC(void) cJSON_Delete(cJSON *item) |
| 265 | { |
| 266 | cJSON *next = NULL; |
| 267 | while (item != NULL) |
| 268 | { |
| 269 | next = item->next; |
| 270 | if (!(item->type & cJSON_IsReference) && (item->child != NULL)) |
| 271 | { |
| 272 | cJSON_Delete(item->child); |
| 273 | } |
| 274 | if (!(item->type & cJSON_IsReference) && (item->valuestring != NULL)) |
| 275 | { |
| 276 | global_hooks.deallocate(item->valuestring); |
| 277 | } |
| 278 | if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) |
| 279 | { |
| 280 | global_hooks.deallocate(item->string); |
| 281 | } |
| 282 | global_hooks.deallocate(item); |
| 283 | item = next; |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | /* get the decimal point character of the current locale */ |
| 288 | static unsigned char get_decimal_point(void) |
no outgoing calls
no test coverage detected
searching dependent graphs…