Bug 131878

Summary: Fix AVPlayerController leak on pages with video
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, eric.carlson, glenn, jeremyj-wk, jer.noble, philipj, sergio
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2014-04-18 21:00:50 PDT
I was seeing leaks of an AVPlayerController allocated with this stack:

        ...
        | WebKit::WebContext::createWebPage(WebKit::PageClient&, WebKit::WebPageConfiguration)
        | WebKit::WebProcessProxy::createWebPage(WebKit::PageClient&, WebKit::WebPageConfiguration const&)
        | WebKit::WebPageProxy::create(WebKit::PageClient&, WebKit::WebProcessProxy&, unsigned long long, WebKit::WebPageConfiguration const&)
        | WebKit::WebPageProxy::WebPageProxy(WebKit::PageClient&, WebKit::WebProcessProxy&, unsigned long long, WebKit::WebPageConfiguration const&)
        | WebKit::WebVideoFullscreenManagerProxy::create(WebKit::WebPageProxy&)
        | WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy(WebKit::WebPageProxy&)
        | WebCore::WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel(WebCore::WebVideoFullscreenModel*)
        | -[WebAVPlayerController init]
        | _objc_rootAlloc
        | class_createInstance
        | calloc
        | malloc_zone_calloc 

The allocation was:

    self.playerControllerProxy = [[classAVPlayerController alloc] init];

This is a (retain) property which will +1 the incoming object, so the alloc/init needs to be balanced.
Comment 1 Joseph Pecoraro 2014-04-18 21:02:47 PDT
Created attachment 229711 [details]
[PATCH] Proposed Fix
Comment 2 WebKit Commit Bot 2014-04-19 15:13:08 PDT
Comment on attachment 229711 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 229711

Committed r167551: <http://trac.webkit.org/changeset/167551>
Comment 3 WebKit Commit Bot 2014-04-19 15:13:13 PDT
All reviewed patches have been landed.  Closing bug.