summaryrefslogtreecommitdiff
path: root/src/plugins/dt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/dt.c')
-rw-r--r--src/plugins/dt.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/plugins/dt.c b/src/plugins/dt.c
index c476dde..d678637 100644
--- a/src/plugins/dt.c
+++ b/src/plugins/dt.c
@@ -204,6 +204,25 @@ static void g_dynamic_types_interface_init(GTypePluginClass *iface)
static void g_dynamic_types_dispose(GDynamicTypes *types)
{
+ size_t i; /* Boucle de parcours */
+ type_dyn_info_t *info; /* Information à exploiter */
+ gpointer g_class; /* Classe à oublier */
+
+ for (i = 0; i < types->count; i++)
+ {
+ info = types->info[i];
+
+ if (info->type != G_TYPE_INVALID)
+ {
+ g_class = g_type_class_peek(info->type);
+ g_type_class_unref(g_class);
+
+ info->type = G_TYPE_INVALID;
+
+ }
+
+ }
+
G_OBJECT_CLASS(g_dynamic_types_parent_class)->dispose(G_OBJECT(types));
}
@@ -223,6 +242,14 @@ static void g_dynamic_types_dispose(GDynamicTypes *types)
static void g_dynamic_types_finalize(GDynamicTypes *types)
{
+ size_t i; /* Boucle de parcours */
+
+ for (i = 0; i < types->count; i++)
+ free(types->info[i]);
+
+ if (types->info != NULL)
+ free(types->info);
+
G_OBJECT_CLASS(g_dynamic_types_parent_class)->finalize(G_OBJECT(types));
}
@@ -367,7 +394,7 @@ static type_dyn_info_t *g_dynamic_types_find(const GDynamicTypes *types, GType t
* *
* Description : Fournit un identifiant GLib pour un nouveau type. *
* *
-* Retour : identifiant d'un nouveau type valide, ou 0. *
+* Retour : identifiant d'un nouveau type valide, ou G_TYPE_INVALID. *
* *
* Remarques : - *
* *
@@ -382,7 +409,7 @@ static GType g_dynamic_types_register_type(GDynamicTypes *types, GType parent, c
result = g_type_register_dynamic(parent, name, G_TYPE_PLUGIN(types), 0);
- if (result == 0)
+ if (result == G_TYPE_INVALID)
goto exit;
new = malloc(sizeof(type_dyn_info_t));
@@ -467,7 +494,7 @@ void exit_chrysalide_dynamic_types(void)
* *
* Description : Fournit un identifiant GLib pour un nouveau type. *
* *
-* Retour : Identifiant d'un nouveau type valide, ou 0. *
+* Retour : Identifiant d'un nouveau type valide, ou G_TYPE_INVALID. *
* *
* Remarques : - *
* *