Memroy leak issue with gstreamer APIs

Yogesh Tyagi yogesh.bit2006 at gmail.com
Mon Nov 24 00:15:23 PST 2014


Hi,

I am getting memory leak issue with following piece of code in my plugin:


*GstPad *peer_pad = gst_pad_get_peer(pad);*
*     if (peer_pad) {*
*       peer_element = (GstElement*) gst_pad_get_parent_element (peer_pad);*
*       if (peer_element) {*
*         GObjectClass *peer_element_class = G_OBJECT_GET_CLASS
(peer_element);*
*         if (peer_element_class) {*
*           peer_element_name = (gchar*)
G_OBJECT_CLASS_NAME(peer_element_class);*
           src_pad_name = gst_pad_get_name (pad);
           if ((src_pad_name != NULL) && (peer_element_name != NULL)) {
                    if (klass->is_ts_demux &&
                 g_strrstr(src_pad_name,"src_vid") &&
                 g_strrstr(peer_element_name,"MssGst")) {
               pass_mss_buffer = TRUE;
             }
           }
           if(src_pad_name)
             g_free(src_pad_name);
     *    }*
*         gst_object_unref (peer_element);*
*       }*
*       gst_object_unref (peer_pad);*

Memory leak goes away if I remove highlighted (in Bold) piece of code. Can
somebody help me here?

Thanks,
Yogesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141124/87c1dc40/attachment.html>


More information about the gstreamer-devel mailing list