Bug 61311 - REGRESSION (86992): World leak when all windows closed
Summary: REGRESSION (86992): World leak when all windows closed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P1 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-05-23 14:50 PDT by Jer Noble
Modified: 2011-05-23 18:02 PDT (History)
1 user (show)

See Also:


Attachments
Patch (4.33 KB, patch)
2011-05-23 14:57 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (4.87 KB, patch)
2011-05-23 15:52 PDT, Jer Noble
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2011-05-23 14:50:51 PDT
REGRESSION (r86990:86992): World leak when all windows closed
Comment 1 Jer Noble 2011-05-23 14:57:04 PDT
Created attachment 94495 [details]
Patch
Comment 2 Jer Noble 2011-05-23 14:57:24 PDT
<rdar://problem/9486740>
Comment 3 Jer Noble 2011-05-23 14:57:42 PDT
Caused by http://trac.webkit.org/changeset/86992.
Comment 4 Darin Adler 2011-05-23 15:03:08 PDT
Comment on attachment 94495 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=94495&action=review

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:-141
> -    [webView retain];
> -    [_webView release];

Are you sure this is necessary? The way this cycle is broken is by calling setWebView:0. Can we leave out this change please? Does the world leak go away if you leave this in?
Comment 5 Jer Noble 2011-05-23 15:12:23 PDT
Comment on attachment 94495 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=94495&action=review

>> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:-141
>> -    [_webView release];
> 
> Are you sure this is necessary? The way this cycle is broken is by calling setWebView:0. Can we leave out this change please? Does the world leak go away if you leave this in?

I think either this, or the "_data->_fullScreenWindowController = nullptr;" change in [WKView closeFullScreenWindowController] would be sufficient to fix this leak.  However, the retain-cycle would still be there, and there may still be an unfound leak because of it.

For safety's sake, we could add a call in [WKView dealloc] which explicitly called [_data->_fullScreenWindowController.get() setWebVIew:nil], and that would be enough to ensure that WKFullScreenWindowController was never pointing to a deleted object.
Comment 6 Jer Noble 2011-05-23 15:52:30 PDT
Created attachment 94508 [details]
Patch
Comment 7 Darin Adler 2011-05-23 16:53:29 PDT
(In reply to comment #5)
> For safety's sake, we could add a call in [WKView dealloc] which explicitly called [_data->_fullScreenWindowController.get() setWebVIew:nil], and that would be enough to ensure that WKFullScreenWindowController was never pointing to a deleted object.

Except under GC.
Comment 8 Darin Adler 2011-05-23 16:54:34 PDT
Comment on attachment 94508 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=94508&action=review

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:-141
> -    [webView retain];
> -    [_webView release];

I still don’t think it was best to remove these. A retain cycle is not intrinsically incorrect, as long as something breaks the cycle.
Comment 9 Jer Noble 2011-05-23 16:58:02 PDT
Comment on attachment 94508 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=94508&action=review

>> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:-141
>> -    [_webView release];
> 
> I still don’t think it was best to remove these. A retain cycle is not intrinsically incorrect, as long as something breaks the cycle.

Okay, I'll upload a new patch that puts these back in.
Comment 10 Jer Noble 2011-05-23 16:58:28 PDT
(In reply to comment #9)
> (From update of attachment 94508 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=94508&action=review
> 
> >> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:-141
> >> -    [_webView release];
> > 
> > I still don’t think it was best to remove these. A retain cycle is not intrinsically incorrect, as long as something breaks the cycle.
> 
> Okay, I'll upload a new patch that puts these back in.

Oh! r+! In that case, I'll check-in a patch that puts these back in.  Thanks!
Comment 11 Jer Noble 2011-05-23 18:02:46 PDT
Committed r87113: <http://trac.webkit.org/changeset/87113>