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