[pygobject] pygobject.c: Don't leak GObjectClass reference
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] pygobject.c: Don't leak GObjectClass reference
- Date: Thu, 4 Oct 2012 07:32:23 +0000 (UTC)
commit 2aa61520eb4f293ce94d54605d7642a39e18e03d
Author: Olivier CrÃte <olivier crete collabora com>
Date: Mon Sep 17 15:16:32 2012 -0400
pygobject.c: Don't leak GObjectClass reference
https://bugzilla.gnome.org/show_bug.cgi?id=684062
gi/_gobject/pygobject.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gi/_gobject/pygobject.c b/gi/_gobject/pygobject.c
index fd6bd4b..e6bb2c9 100644
--- a/gi/_gobject/pygobject.c
+++ b/gi/_gobject/pygobject.c
@@ -226,6 +226,8 @@ build_parameter_list(GObjectClass *class)
g_free(name);
}
+ g_type_class_unref(class);
+
if (props)
g_free(props);
@@ -255,8 +257,10 @@ PyGProps_getattro(PyGProps *self, PyObject *attr)
if (self->pygobject != NULL) {
ret = pygi_get_property_value (self->pygobject, attr_name);
- if (ret != NULL)
+ if (ret != NULL) {
+ g_type_class_unref(class);
return ret;
+ }
}
pspec = g_object_class_find_property(class, attr_name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]