From 2ee14706117fc5551a885741857e21816269678f Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 30 Aug 2008 02:31:53 +0000 Subject: [PATCH] Add some assertions, blacklist a few more methods * girepository/ginfo.c: Add some assertions regarding refcounts, just to be sure. * giscanner/glibtransformer.py: Blacklist a few more odd Gio methods. svn path=/trunk/; revision=537 --- ginfo.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ginfo.c b/ginfo.c index b48541aa2..4625e8504 100644 --- a/ginfo.c +++ b/ginfo.c @@ -203,6 +203,7 @@ g_base_info_ref (GIBaseInfo *info) void g_base_info_unref (GIBaseInfo *info) { + g_assert (info->ref_count > 0); info->ref_count--; if (!info->ref_count) @@ -224,6 +225,7 @@ g_base_info_get_type (GIBaseInfo *info) const gchar * g_base_info_get_name (GIBaseInfo *info) { + g_assert (info->ref_count > 0); switch (info->type) { case GI_INFO_TYPE_FUNCTION: @@ -302,6 +304,7 @@ g_base_info_get_name (GIBaseInfo *info) case GI_INFO_TYPE_TYPE: default: ; + g_assert_not_reached (); /* unnamed */ } @@ -311,7 +314,9 @@ g_base_info_get_name (GIBaseInfo *info) const gchar * g_base_info_get_namespace (GIBaseInfo *info) { - Header *header = (Header *)info->typelib->data; + Header *header = (Header *)info->typelib->data; + + g_assert (info->ref_count > 0); if (info->type == GI_INFO_TYPE_UNRESOLVED) {