aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-object.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-object.c')
-rw-r--r--camel/camel-object.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/camel/camel-object.c b/camel/camel-object.c
index eebcbf35d2..5e7eac7504 100644
--- a/camel/camel-object.c
+++ b/camel/camel-object.c
@@ -409,18 +409,27 @@ camel_object_new(CamelType type)
}
void
-camel_object_ref(CamelObject *o)
+camel_object_ref(void *vo)
{
+ register CamelObject *o = vo;
+
+ g_return_if_fail(CAMEL_IS_OBJECT(o));
+
CLASS_LOCK(o->klass);
o->ref_count++;
CLASS_UNLOCK(o->klass);
}
void
-camel_object_unref(CamelObject *o)
+camel_object_unref(void *vo)
{
- register CamelObjectClass *klass = o->klass, *k;
+ register CamelObject *o = vo;
+ register CamelObjectClass *klass, *k;
+
+ g_return_if_fail(CAMEL_IS_OBJECT(o));
+ klass = o->klass;
+
CLASS_LOCK(klass);
o->ref_count--;
if (o->ref_count > 0