gst/gstbuffer.override: a buffer is not a boxed

Original commit message from CVS:

* gst/gstbuffer.override:
a buffer is not a boxed
* gst/gstobject.override:
use Py_VISIT for cleaner and more pythonic code
do not visit GstObjects that still have a parent
This commit is contained in:
Thomas Vander Stichele 2005-10-05 14:26:24 +00:00
parent aabc3e7be1
commit 02193a3552
3 changed files with 18 additions and 14 deletions

View file

@ -1,3 +1,11 @@
2005-10-05 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/gstbuffer.override:
a buffer is not a boxed
* gst/gstobject.override:
use Py_VISIT for cleaner and more pythonic code
do not visit GstObjects that still have a parent
2005-10-05 Edward Hervey <edward@fluendo.com>
* codegen/argtypes.py:

View file

@ -102,7 +102,7 @@ _wrap_gst_buffer_tp_repr (PyGstMiniObject *self)
PyObject *ret;
g_assert (self);
buf = pyg_boxed_get (self, GstBuffer);
buf = GST_BUFFER(self->obj);
g_assert (buf);
size = GST_BUFFER_SIZE (buf);

View file

@ -46,7 +46,6 @@ _wrap_gst_object__get___gstrefcount__(PyGObject *self, void *closure)
* compare with pygtk/gobject/pygobject.c
*/
/* a define is a little evil, but it seems to generate the right code
* to allow us to do our garbage collection routines */
%%
@ -64,23 +63,17 @@ _wrap_gst_object_tp_traverse(PyGObject *self, visitproc visit, void *arg)
GST_LOG_OBJECT(self->obj,
"gst.Object.tp_traverse");
if (self->inst_dict) ret = visit(self->inst_dict, arg);
if (ret != 0) return ret;
Py_VISIT(self->inst_dict);
for (tmp = self->closures; tmp != NULL; tmp = tmp->next) {
PyGClosure *closure = tmp->data;
if (closure->callback) ret = visit(closure->callback, arg);
if (ret != 0) return ret;
if (closure->extra_args) ret = visit(closure->extra_args, arg);
if (ret != 0) return ret;
if (closure->swap_data) ret = visit(closure->swap_data, arg);
if (ret != 0) return ret;
Py_VISIT(closure->callback);
Py_VISIT(closure->extra_args);
Py_VISIT(closure->swap_data);
}
if (self->obj && GST_OBJECT_REFCOUNT_VALUE(self->obj) == 1) {
if (self->obj && GST_OBJECT_REFCOUNT_VALUE(self->obj) == 1 && GST_OBJECT(self->obj)->parent == NULL) {
GST_DEBUG_OBJECT(self->obj,
"gst.Object.tp_traverse: GstObject refcount of %p is 1, visit",
self->obj);
@ -106,7 +99,10 @@ _wrap_gst_object_tp_clear(PyGObject *self)
if (! GST_IS_OBJECT (obj))
obj = NULL;
else {
GST_DEBUG_OBJECT (obj, "gst.Object.tp_clear");
GST_DEBUG_OBJECT (obj,
"gst.Object.tp_clear, pyo %p, pyo rc %d, gsto %p, gst rc %d",
self, ((PyObject *) self)->ob_refcnt, obj,
GST_OBJECT_REFCOUNT_VALUE (obj));
g_object_ref (obj);
}