631 |
631 |
632 return result; |
632 return result; |
633 } |
633 } |
634 |
634 |
635 void cxJsonValueFree(CxJsonValue *value) { |
635 void cxJsonValueFree(CxJsonValue *value) { |
636 if (value == NULL || value == &cx_json_value_nothing) return; |
636 if (value == NULL || value->type == CX_JSON_NOTHING) return; |
637 |
|
638 switch (value->type) { |
637 switch (value->type) { |
639 case CX_JSON_OBJECT: { |
638 case CX_JSON_OBJECT: { |
640 CxJsonObject obj = value->value.object; |
639 CxJsonObject obj = value->value.object; |
641 for (size_t i = 0; i < obj.values_size; i++) { |
640 for (size_t i = 0; i < obj.values_size; i++) { |
642 cxJsonValueFree(obj.values[i].value); |
641 cxJsonValueFree(obj.values[i].value); |