Don't leak WKBrowsingContextControllers
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jun 2014 23:53:37 +0000 (23:53 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jun 2014 23:53:37 +0000 (23:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134368
<rdar://problem/17476582>

Reviewed by Sam Weinig.

* UIProcess/API/mac/WKView.mm:
(-[WKView browsingContextController]):
Adoption is important.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170508 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/WKView.mm

index d33b911221d522876f86b0cbeb0e586086ef74e7..12d8b10faea66b24b878bd476348a0b9ff10b881 100644 (file)
@@ -1,3 +1,15 @@
+2014-06-26  Tim Horton  <timothy_horton@apple.com>
+
+        Don't leak WKBrowsingContextControllers
+        https://bugs.webkit.org/show_bug.cgi?id=134368
+        <rdar://problem/17476582>
+
+        Reviewed by Sam Weinig.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView browsingContextController]):
+        Adoption is important.
+
 2014-06-26  Alexey Proskuryakov  <ap@apple.com>
 
         REGRESSION: Mountain Lion: Gmail's "in new window" view of mail threads is very slow to load its content
index 5be605647d17a92aed6ca72bb62c582d1e54cb88..0e1d94b674d6d16880923624202b858c3ac6655e 100644 (file)
@@ -315,7 +315,7 @@ struct WKViewInterpretKeyEventsParameters {
 - (WKBrowsingContextController *)browsingContextController
 {
     if (!_data->_browsingContextController)
-        _data->_browsingContextController = [[WKBrowsingContextController alloc] _initWithPageRef:toAPI(_data->_page.get())];
+        _data->_browsingContextController = adoptNS([[WKBrowsingContextController alloc] _initWithPageRef:toAPI(_data->_page.get())]);
 
     return _data->_browsingContextController.get();
 }