MCPcopy Create free account
hub / github.com/Bwar/CJsonObject / cJSON_Delete

Function cJSON_Delete

cJSON.c:101–116  ·  view source on GitHub ↗

Delete a cJSON structure. */

Source from the content-addressed store, hash-verified

99
100/* Delete a cJSON structure. */
101void cJSON_Delete(cJSON *c)
102{
103 cJSON *next;
104 while (c)
105 {
106 next = c->next;
107 if (!(c->type & cJSON_IsReference) && c->child)
108 cJSON_Delete(c->child);
109 if (!(c->type & cJSON_IsReference) && c->valuestring)
110 cJSON_free(c->valuestring);
111 if (c->string)
112 cJSON_free(c->string);
113 cJSON_free(c);
114 c = next;
115 }
116}
117
118/* Parse the input text to generate a number, and populate the result into item. */
119static const char *parse_number(cJSON *item, const char *num)

Callers 5

ClearMethod · 0.85
cJSON_ParseFunction · 0.85
cJSON_ReplaceItemInArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected