diff options
author | Mark Doffman <mark.doffman@codethink.co.uk> | 2014-03-27 20:50:21 +0000 |
---|---|---|
committer | Mark Doffman <mark.doffman@codethink.co.uk> | 2014-03-27 20:50:21 +0000 |
commit | 68ff94340891f1ae4ea24546acdbbc39c4dcbcd0 (patch) | |
tree | 46f02cba671bcb321482c7961acd91aeee57ced5 /girepository/gibaseinfo.c | |
parent | 19da3f81593614198206c45527f973a22cdd621e (diff) | |
parent | 89e84d06dffbc732bac26a105244b7270c42e3ec (diff) | |
download | gobject-introspection-68ff94340891f1ae4ea24546acdbbc39c4dcbcd0.tar.gz |
Merge tag 'GOBJECT_INTROSPECTION_1_39_90' into baserock/markdoffman/1_39_90-mergebaserock/markdoffman/1_39_90-merge
Tag 1_39_90
Conflicts:
autogen.sh
configure.ac
Diffstat (limited to 'girepository/gibaseinfo.c')
-rw-r--r-- | girepository/gibaseinfo.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/girepository/gibaseinfo.c b/girepository/gibaseinfo.c index ff9c9395..4bbe850a 100644 --- a/girepository/gibaseinfo.c +++ b/girepository/gibaseinfo.c @@ -71,6 +71,17 @@ _g_info_new_full (GIInfoType type, return (GIBaseInfo*)info; } +/** + * g_info_new: + * @type: TODO + * @container: TODO + * @typelib: TODO + * @offset: TODO + * + * TODO + * + * Returns: TODO + */ GIBaseInfo * g_info_new (GIInfoType type, GIBaseInfo *container, @@ -169,8 +180,8 @@ _g_type_info_init (GIBaseInfo *info, /** * SECTION:gibaseinfo - * @Short_description: Base struct for all GITypelib structs - * @Title: GIBaseInfo + * @title: GIBaseInfo + * @short_description: Base struct for all GITypelib structs * * GIBaseInfo is the common base struct of all other *Info structs * accessible through the #GIRepository API. @@ -209,7 +220,6 @@ _g_type_info_init (GIBaseInfo *info, * +----<link linkend="gi-GITypeInfo">GITypeInfo</link> * </synopsis> * </refsect1> - * */ /** @@ -226,7 +236,7 @@ g_base_info_ref (GIBaseInfo *info) GIRealInfo *rinfo = (GIRealInfo*)info; g_assert (rinfo->ref_count != INVALID_REFCOUNT); - ((GIRealInfo*)info)->ref_count++; + g_atomic_int_inc (&rinfo->ref_count); return info; } @@ -244,21 +254,20 @@ g_base_info_unref (GIBaseInfo *info) GIRealInfo *rinfo = (GIRealInfo*)info; g_assert (rinfo->ref_count > 0 && rinfo->ref_count != INVALID_REFCOUNT); - rinfo->ref_count--; - if (!rinfo->ref_count) - { - if (rinfo->container && ((GIRealInfo *) rinfo->container)->ref_count != INVALID_REFCOUNT) - g_base_info_unref (rinfo->container); + if (!g_atomic_int_dec_and_test (&rinfo->ref_count)) + return; - if (rinfo->repository) - g_object_unref (rinfo->repository); + if (rinfo->container && ((GIRealInfo *) rinfo->container)->ref_count != INVALID_REFCOUNT) + g_base_info_unref (rinfo->container); - if (rinfo->type == GI_INFO_TYPE_UNRESOLVED) - g_slice_free (GIUnresolvedInfo, (GIUnresolvedInfo *) rinfo); - else - g_slice_free (GIRealInfo, rinfo); - } + if (rinfo->repository) + g_object_unref (rinfo->repository); + + if (rinfo->type == GI_INFO_TYPE_UNRESOLVED) + g_slice_free (GIUnresolvedInfo, (GIUnresolvedInfo *) rinfo); + else + g_slice_free (GIRealInfo, rinfo); } /** |