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 592884 - [playbin2] g_object_get increases refcount by 2 and therefore leaves memleak
[playbin2] g_object_get increases refcount by 2 and therefore leaves memleak
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.24
Other Linux
: Normal critical
: 0.10.25
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-08-24 11:47 UTC by Andreas Frisch
Modified: 2009-08-24 13:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
possible fix (555 bytes, patch)
2009-08-24 12:53 UTC, Andreas Frisch
none Details | Review

Description Andreas Frisch 2009-08-24 11:47:44 UTC
looks as if gst_play_bin_get_current_sink does a g_object_ref and g_value_set_object does too which results in the refcount being increased by 2. therefore this requires double unref'ing to avoid memory leaking.

this call invokes the issue:

g_object_get (G_OBJECT (m_gst_playbin), "audio-sink", &sink, NULL);
Comment 1 Andreas Frisch 2009-08-24 12:53:35 UTC
Created attachment 141550 [details] [review]
possible fix
Comment 2 Wim Taymans 2009-08-24 13:09:23 UTC
commit c3ebeec5a54c6c00bf30f7196968a9369c3d8205
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Mon Aug 24 15:06:28 2009 +0200

    playbin2: fix refcounting of _get_sink()
    
    g_value_set_object() increases the refcount of the sink, which is not needed
    because the object should already be refcounted. Make sure this is always the
    case and use g_value_take_object().
    
    Fixes: #592884