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