Bug 74224 - [GStreamer] webkitwebsrc: pad template is leaked
Summary: [GStreamer] webkitwebsrc: pad template is leaked
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-09 15:49 PST by Judy Liqiong Hao
Modified: 2012-01-09 12:18 PST (History)
3 users (show)

See Also:


Attachments
proposed patch (1.36 KB, patch)
2011-12-09 16:14 PST, Judy Liqiong Hao
no flags Details | Formatted Diff | Diff
Patch (1.95 KB, patch)
2012-01-09 10:46 PST, Judy Liqiong Hao
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Judy Liqiong Hao 2011-12-09 15:49:21 PST
There is a memory leak in function "webkit_web_src_init" of "WebKitWebSourceGStreamer.cpp" 
with setting pad-templates for ghostpads.

gst_static_pad_template_get() is used to get a GstPadTemplate out of static pad
template. This is then passed as a parameter to gst_ghost_pad_new_from_template, 
which does a ref, but does not take ownership. 

Attached is a patch that unrefs the pad template after it's used.
Comment 1 Judy Liqiong Hao 2011-12-09 16:14:40 PST
Created attachment 118663 [details]
proposed patch
Comment 2 Philippe Normand 2011-12-12 01:24:42 PST
Thanks for spotting this!
The pad template is still leaked in the case where appsrc is not created though?

Can you use GRefPtr for this GstPadTemplate pointer? You'd need to add support for it in GRefPtrGStreamer.
Comment 3 Philippe Normand 2011-12-14 08:41:12 PST
Comment on attachment 118663 [details]
proposed patch

r- as per above remarks, some of which I applied in the patch of bug 74495
Comment 4 Philippe Normand 2012-01-04 05:28:12 PST
Ping Judy?
Comment 5 Judy Liqiong Hao 2012-01-04 09:59:41 PST
(In reply to comment #4)
> Ping Judy?

Yes?
Comment 6 Philippe Normand 2012-01-05 00:30:51 PST
(In reply to comment #5)
> (In reply to comment #4)
> > Ping Judy?
> 
> Yes?

Do you mind updating this patch?
Comment 7 Judy Liqiong Hao 2012-01-05 17:19:14 PST
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > Ping Judy?
> > 
> > Yes?
> Do you mind updating this patch?

Will send out a new patch for review ...
Comment 8 Judy Liqiong Hao 2012-01-09 10:46:41 PST
Created attachment 121685 [details]
Patch
Comment 9 WebKit Review Bot 2012-01-09 12:18:28 PST
Comment on attachment 121685 [details]
Patch

Clearing flags on attachment: 121685

Committed r104475: <http://trac.webkit.org/changeset/104475>
Comment 10 WebKit Review Bot 2012-01-09 12:18:32 PST
All reviewed patches have been landed.  Closing bug.