[gjs/wip/gdbus-2: 1/13] Assorted memory leak fixes
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/gdbus-2: 1/13] Assorted memory leak fixes
- Date: Fri, 2 Nov 2012 13:10:04 +0000 (UTC)
commit d10cdb471bd101065961bb2b6321630ca15ef356
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Sat Jul 7 15:07:14 2012 +0200
Assorted memory leak fixes
Spotted by valgrind.
https://bugzilla.gnome.org/show_bug.cgi?id=679688
gi/object.c | 4 +++-
gi/param.c | 1 +
2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gi/object.c b/gi/object.c
index fb77924..9909e30 100644
--- a/gi/object.c
+++ b/gi/object.c
@@ -369,10 +369,11 @@ find_vfunc_on_parent(GIObjectInfo *info,
while (!vfunc && parent) {
old_parent = parent;
parent = g_object_info_get_parent(old_parent);
+ g_base_info_unref(old_parent);
+
if (!parent)
break;
- g_base_info_unref(old_parent);
vfunc = g_object_info_find_vfunc(parent, name);
}
@@ -2409,6 +2410,7 @@ gjs_register_property(JSContext *cx,
priv = priv_from_js(cx, obj);
pspec = gjs_g_param_from_param(cx, pspec_js);
+ g_param_spec_ref(pspec);
g_param_spec_set_qdata(pspec, gjs_is_custom_property_quark(), GINT_TO_POINTER(1));
diff --git a/gi/param.c b/gi/param.c
index 509bdf7..63c23d4 100644
--- a/gi/param.c
+++ b/gi/param.c
@@ -412,6 +412,7 @@ param_new_internal(JSContext *cx,
ret = JS_TRUE;
jsval foo = OBJECT_TO_JSVAL(gjs_param_from_g_param(cx, pspec));
+ g_param_spec_unref(pspec);
JS_SET_RVAL(cx, vp, foo);
out:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]