diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2024-11-15 09:54:42 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2024-11-15 09:54:42 (GMT) |
commit | adf4a8d487a46611f592a8189076cd2088fddeb0 (patch) | |
tree | 2d62dcdd4beff4b653341fabf3910069ef152071 | |
parent | 2eca5b9056aa44760ee4981b0418652a04bfd6f2 (diff) |
Handle the case of unbuildable dynamic classes when freeing resources.
-rw-r--r-- | src/plugins/dt.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/plugins/dt.c b/src/plugins/dt.c index 28b70bb..2899845 100644 --- a/src/plugins/dt.c +++ b/src/plugins/dt.c @@ -215,7 +215,24 @@ static void g_dynamic_types_dispose(GDynamicTypes *types) if (info->type != G_TYPE_INVALID) { g_class = g_type_class_peek(info->type); - g_type_class_unref(g_class); + + /** + * Constat est fait qu'un type implémenté en Python mais dont les + * instanciations conduisent toutes à des exceptions n'est pas + * associé à une classe à ce moment d'exécution. + * + * Cf. fonction testKnownFormatConstructor() de la suite de tests + * + * Cf. documentation de g_type_class_unref() également : + * + * """ + * Once the last reference count of a class has been released, + * classes may be finalized by the type system + * """ + */ + + if (g_class != NULL) + g_type_class_unref(g_class); info->type = G_TYPE_INVALID; |