diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2021-03-07 21:20:37 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2021-03-07 21:20:37 (GMT) |
commit | c728479b9006dde8d377e9029936de9a625c806b (patch) | |
tree | 36228a10cca08737a3df9c4eb22dc490d3205452 /src/analysis/types/template.c | |
parent | fde9e3b46192a065ec622da1395c48015df3cf32 (diff) |
Load and store data types with proper functions.
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: |