MCPcopy Create free account
hub / github.com/Tencent/Hardcoder / cJSON_Delete

Function cJSON_Delete

libapp2sys/src/main/cpp/cjson/cJSON.c:215–236  ·  view source on GitHub ↗

Delete a cJSON structure. */

Source from the content-addressed store, hash-verified

213
214/* Delete a cJSON structure. */
215CJSON_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 */
239static unsigned char get_decimal_point(void)

Callers 15

checkPermissionMethod · 0.85
requestCpuHighFreqMethod · 0.85
cancelCpuHighFreqMethod · 0.85
requestGpuHighFreqMethod · 0.85
cancelGpuHighFreqMethod · 0.85
requestHighIOFreqMethod · 0.85
cancelHighIOFreqMethod · 0.85
resetScreenResolutionMethod · 0.85
registerANRCallbackMethod · 0.85

Calls 1

deallocateMethod · 0.80

Tested by

no test coverage detected