|
@@ -418,6 +418,7 @@ void ini_array_encoder(JsonArray* this) {
|
|
|
//Initialisation en mode encoder
|
|
|
this->mode = JSON_ARRAY_ENCODER;
|
|
|
this->encoder = malloc(sizeof (JsonArrayEncoder));
|
|
|
+ this->encoder->tab = NULL;
|
|
|
}
|
|
|
|
|
|
boolean add_array_value(JsonArray* this, char* str) {
|
|
@@ -546,7 +547,7 @@ char* json_encode_array(JsonArray* this) {
|
|
|
/* --- Fonctions publiques --- */
|
|
|
|
|
|
void clean_json_array(JsonArray* this) {
|
|
|
- if (this->mode) {
|
|
|
+ if (this->mode == JSON_ARRAY_ENCODER) {
|
|
|
JsonNode* node, * tmp;
|
|
|
node = this->encoder->tab;
|
|
|
while (node != NULL) {
|
|
@@ -556,7 +557,6 @@ void clean_json_array(JsonArray* this) {
|
|
|
node = tmp;
|
|
|
}
|
|
|
free(this->encoder);
|
|
|
-
|
|
|
} else {
|
|
|
//Parser
|
|
|
free(this->parser->type);
|