Delete a cJSON structure. */
| 251 | |
| 252 | /* Delete a cJSON structure. */ |
| 253 | CJSON_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 */ |
| 277 | static unsigned char get_decimal_point(void) |
no outgoing calls
no test coverage detected