summaryrefslogtreecommitdiff
path: root/gst/gstobject.override
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2005-10-05 16:19:13 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2005-10-05 16:19:13 +0000
commitdeb316e3fdc1a5c7f5eed927c7730b5e6efca6b4 (patch)
tree54187062971b5912135861a656fa154d01f43658 /gst/gstobject.override
parent2d361383fc386fa8d3cd61948e86e3f93f9fd810 (diff)
gst/gstobject.override: don't try and unref objects that are already finalizing
Original commit message from CVS: * gst/gstobject.override: don't try and unref objects that are already finalizing * gst/gstpad.override: fix up the set_chainfunc method * testsuite/common.py: * testsuite/test_pad.py: add linked/unlinked tests with no/true/false bufferprobes
Diffstat (limited to 'gst/gstobject.override')
-rw-r--r--gst/gstobject.override15
1 files changed, 11 insertions, 4 deletions
diff --git a/gst/gstobject.override b/gst/gstobject.override
index 8fe985f..d0e362e 100644
--- a/gst/gstobject.override
+++ b/gst/gstobject.override
@@ -123,11 +123,18 @@ _wrap_gst_object_tp_dealloc(PyGObject *self)
/* if we're a GstObject, we want to monkeypatch the GObject.tp_dealloc's
* g_object_unref and "replace" it with a gst_object_unref */
- if (! GST_IS_OBJECT (obj))
+ if (GST_IS_OBJECT (obj)) {
+ GST_DEBUG_OBJECT (obj, "gst.Object.tp_dealloc, go rc %d, gsto rc %d",
+ obj->ref_count, GST_OBJECT_REFCOUNT_VALUE (obj));
+ if (GST_OBJECT_REFCOUNT_VALUE (obj) == 0) {
+ /* already being finalized, can't resurrect object */
+ obj = NULL;
+ self->obj = NULL;
+ } else {
+ g_object_ref (obj);
+ }
+ } else {
obj = NULL;
- else {
- GST_DEBUG_OBJECT (obj, "gst.Object.tp_dealloc");
- g_object_ref (obj);
}
PyGObject_Type.tp_dealloc((PyObject *) self);