After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 339308 - MiniObject arguments for virtual methods shouldn't have their refcount incremented
MiniObject arguments for virtual methods shouldn't have their refcount increm...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-python
git master
Other Linux
: Normal normal
: 0.10.5
Assigned To: GStreamer Maintainers
Johan (not receiving bugmail) Dahlin
Depends on:
Blocks:
 
 
Reported: 2006-04-21 14:48 UTC by Edward Hervey
Modified: 2006-04-28 17:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix refcount issues with miniobject in virtual methods (1.50 KB, patch)
2006-04-21 14:52 UTC, Edward Hervey
committed Details | Review
Showcase for big refcount in BaseTransform.do_transform_ip (1.43 KB, text/x-python)
2006-04-22 01:51 UTC, Артём Попов
  Details

Description Edward Hervey 2006-04-21 14:48:12 UTC
When a GstMiniObject is an argument for a virtual method implemented in python, its refcount shouldn't be incremented when passing it along to the python method.

The solution should be to:
1/ wrap it in a pygstminiobject (with pygstminiobject_new())
2/ unref it once (gst_mini_object_unref())

3/ call the python method

4/ ref the miniobject (gst_mini_object_ref())
5/ decrement the refcount on the pygstminiobject (Py_DECREF())
Comment 1 Edward Hervey 2006-04-21 14:51:12 UTC
This can be easily fixed by modifying the GstMiniObjectParam parameter used by the codegenerator and defined in arg-types.py.

A patch follows with suggested fix
Comment 2 Edward Hervey 2006-04-21 14:52:06 UTC
Created attachment 64055 [details] [review]
patch to fix refcount issues with miniobject in virtual methods
Comment 3 Артём Попов 2006-04-22 01:49:53 UTC
Even with this patch I'm still encountering an incremented refcount (see the attached code). do_transform_ip method show that the refcount of passed buffer is 2, what makes the buffer unwritable.
Comment 4 Артём Попов 2006-04-22 01:51:28 UTC
Created attachment 64086 [details]
Showcase for big refcount in BaseTransform.do_transform_ip
Comment 5 Edward Hervey 2006-04-28 17:55:16 UTC
The refcount too big in do_transform_ip() is a problem in the C BaseTransform : #340045

Closing this bug since following is commited.

2006-04-28  Edward Hervey  <edward@fluendo.com>

	* gst/arg-types.py:
	GstMiniObject used as virtual methods parameters should be unreffed
	before calling the method and the ref-ed.
	Added Params and Returns for const-gchar*, GType and gulong so the
	code generator can generate more virtual methods handlers/proxys.