Don't leak _WKRemoteObjectRegistry in WKBrowsingContextController
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Jul 2014 01:56:28 +0000 (01:56 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Jul 2014 01:56:28 +0000 (01:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134703

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController _remoteObjectRegistry]):
Adoption is important!!

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm

index ab6d4a8f6b7575963f5c0991cb81a44df263fd19..be631437f4f007838bca2123d02a7ea6c670f45e 100644 (file)
@@ -1,3 +1,14 @@
+2014-07-07  Timothy Horton  <timothy_horton@apple.com>
+
+        Don't leak _WKRemoteObjectRegistry in WKBrowsingContextController
+        https://bugs.webkit.org/show_bug.cgi?id=134703
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
+        (-[WKBrowsingContextController _remoteObjectRegistry]):
+        Adoption is important!!
+
 2014-07-07  Simon Fraser  <simon.fraser@apple.com>
 
         [UI-side compositing] Support reflections on custom layers like video
index 1d8234c2aabf24a417acce57817ec1d8e3e38cdc..3dea52ebc44a701815c4e14411ffccb4738d168b 100644 (file)
@@ -859,7 +859,7 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
 - (_WKRemoteObjectRegistry *)_remoteObjectRegistry
 {
     if (!_remoteObjectRegistry) {
-        _remoteObjectRegistry = [[_WKRemoteObjectRegistry alloc] _initWithMessageSender:*_page];
+        _remoteObjectRegistry = adoptNS([[_WKRemoteObjectRegistry alloc] _initWithMessageSender:*_page]);
         _page->process().context().addMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _page->pageID(), [_remoteObjectRegistry remoteObjectRegistry]);
     }