[pygobject] Do not leak info of destroy notify
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Do not leak info of destroy notify
- Date: Mon, 31 Mar 2014 21:43:56 +0000 (UTC)
commit 2e853f6a31636d6a26ce91eb30be5bb0326474b1
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Mar 30 18:27:59 2014 +0200
Do not leak info of destroy notify
gi/pygi-closure.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/gi/pygi-closure.c b/gi/pygi-closure.c
index b803541..42692e9 100644
--- a/gi/pygi-closure.c
+++ b/gi/pygi-closure.c
@@ -712,21 +712,22 @@ static PyGICClosure*
_pygi_destroy_notify_create (void)
{
if (!global_destroy_notify) {
-
- PyGICClosure *destroy_notify = g_slice_new0 (PyGICClosure);
- GIBaseInfo* glib_destroy_notify;
-
- g_assert (destroy_notify);
+ GIBaseInfo *glib_destroy_notify;
+ PyGICClosure *destroy_notify;
glib_destroy_notify = g_irepository_find_by_name (NULL, "GLib", "DestroyNotify");
g_assert (glib_destroy_notify != NULL);
g_assert (g_base_info_get_type (glib_destroy_notify) == GI_INFO_TYPE_CALLBACK);
+ destroy_notify = g_slice_new0 (PyGICClosure);
+
destroy_notify->closure = g_callable_info_prepare_closure ( (GICallableInfo*) glib_destroy_notify,
&destroy_notify->cif,
_pygi_destroy_notify_callback_closure,
NULL);
+ g_base_info_unref (glib_destroy_notify);
+
global_destroy_notify = destroy_notify;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]