summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Henstridge <james@daa.com.au>2001-10-02 15:07:13 +0000
committerJames Henstridge <jamesh@src.gnome.org>2001-10-02 15:07:13 +0000
commit262f3f547ab4d74b09b1a7150daaff846a926409 (patch)
treeb1593c35203aa38d2b178e06d058dd221dfb8476
parent670349eb2f4acd6a9291fb0ed57283fb999653c8 (diff)
downloadpygobject-262f3f547ab4d74b09b1a7150daaff846a926409.tar.gz
pygobject-262f3f547ab4d74b09b1a7150daaff846a926409.tar.xz
pygobject-262f3f547ab4d74b09b1a7150daaff846a926409.zip
fix bug where we were INCREFing the saved widget even in the hasref case
2001-10-02 James Henstridge <james@daa.com.au> * gobjectmodule.c (pygobject_new): fix bug where we were INCREFing the saved widget even in the hasref case (where we should be passing ownership of the last reference).
-rw-r--r--gobject/gobjectmodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index e49c64f..88f5d38 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -308,8 +308,8 @@ pygobject_new(GObject *obj)
self->hasref = FALSE;
g_object_steal_qdata(obj, pygobject_ownedref_key);
g_object_ref(obj);
- }
- Py_INCREF(self);
+ } else
+ Py_INCREF(self);
return (PyObject *)self;
}
@@ -1095,6 +1095,7 @@ pygobject_dealloc(PyGObject *self)
self->hasref = TRUE;
g_object_set_qdata_full(obj, pygobject_ownedref_key,
self, pygobject_destroy_notify);
+ g_message("ref count = %d", self->ob_refcnt);
g_object_unref(obj);
return;
}