diff options
Diffstat (limited to 'src/analysis/types/template.c')
-rw-r--r-- | src/analysis/types/template.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/analysis/types/template.c b/src/analysis/types/template.c index 05f7a2f..98c1471 100644 --- a/src/analysis/types/template.c +++ b/src/analysis/types/template.c @@ -160,7 +160,7 @@ static void g_template_type_dispose(GTemplateType *type) size_t i; /* Boucle de parcours */ for (i = 0; i < type->count; i++) - g_object_unref(G_OBJECT(type->params[i])); + g_clear_object(&type->params[i]); G_OBJECT_CLASS(g_template_type_parent_class)->dispose(G_OBJECT(type)); @@ -253,11 +253,15 @@ static bool g_template_type_load(GTemplateType *type, GObjectStorage *storage, p for (i = 0; i < type->count; i++) { - result = g_serializable_object_load(G_SERIALIZABLE_OBJECT(type->params[i]), storage, pbuf); - if (!result) goto exit; + type->params[i] = G_DATA_TYPE(g_object_storage_unpack_object(storage, "types", pbuf)); + + if (type->params[i] == NULL) + break; } + result = (i == type->count); + exit: return result; @@ -301,9 +305,8 @@ static bool g_template_type_store(const GTemplateType *type, GObjectStorage *sto for (i = 0; i < type->count; i++) { - result = g_serializable_object_store(G_SERIALIZABLE_OBJECT(type->params[i]), storage, pbuf); + result = g_object_storage_pack_object(storage, "types", G_SERIALIZABLE_OBJECT(type->params[i]), pbuf); if (!result) goto exit; - } exit: |