Title: [204232] trunk/Source/WebKit2
Revision
204232
Author
m...@apple.com
Date
2016-08-06 18:41:40 -0700 (Sat, 06 Aug 2016)

Log Message

[Cocoa] -[_WKRemoteObjectRegistry() _invokeMethod:] leaks a block
https://bugs.webkit.org/show_bug.cgi?id=160636

Reviewed by Darin Adler.

* Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
(-[_WKRemoteObjectRegistry _invokeMethod:]): Release the block returned from
  __NSMakeSpecialForwardingCaptureBlock.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (204231 => 204232)


--- trunk/Source/WebKit2/ChangeLog	2016-08-06 23:43:35 UTC (rev 204231)
+++ trunk/Source/WebKit2/ChangeLog	2016-08-07 01:41:40 UTC (rev 204232)
@@ -1,3 +1,14 @@
+2016-08-06  Dan Bernstein  <m...@apple.com>
+
+        [Cocoa] -[_WKRemoteObjectRegistry() _invokeMethod:] leaks a block
+        https://bugs.webkit.org/show_bug.cgi?id=160636
+
+        Reviewed by Darin Adler.
+
+        * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
+        (-[_WKRemoteObjectRegistry _invokeMethod:]): Release the block returned from
+          __NSMakeSpecialForwardingCaptureBlock.
+
 2016-08-06  Chris Dumez  <cdu...@apple.com>
 
         Write API test to cover crash fix in r204135

Modified: trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm (204231 => 204232)


--- trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm	2016-08-06 23:43:35 UTC (rev 204231)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm	2016-08-07 01:41:40 UTC (rev 204232)
@@ -217,7 +217,6 @@
             RetainPtr<_WKRemoteObjectRegistry> remoteObjectRegistry = self;
             uint64_t replyID = replyInfo->replyID;
             id replyBlock = __NSMakeSpecialForwardingCaptureBlock(wireBlockSignature._typeString.UTF8String, [interface, remoteObjectRegistry, replyID](NSInvocation *invocation) {
-
                 auto encoder = adoptNS([[WKRemoteObjectEncoder alloc] init]);
                 [encoder encodeObject:invocation forKey:invocationKey];
 
@@ -228,6 +227,8 @@
 
             // Make sure that the block won't be destroyed before the invocation.
             objc_setAssociatedObject(invocation, replyBlockKey, replyBlock, OBJC_ASSOCIATION_RETAIN);
+            [replyBlock release];
+
             break;
         }
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to