Title: [181992] trunk/Source/_javascript_Core
Revision
181992
Author
[email protected]
Date
2015-03-25 20:11:04 -0700 (Wed, 25 Mar 2015)

Log Message

[Cocoa] RemoteInspectorXPCConnection::deserializeMessage() leaks a NSDictionary under Objective-C GC
https://bugs.webkit.org/show_bug.cgi?id=143068

Reviewed by Dan Bernstein.

* inspector/remote/RemoteInspectorXPCConnection.mm:
(Inspector::RemoteInspectorXPCConnection::deserializeMessage): Used RetainPtr::autorelease(), which does the right thing under GC.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (181991 => 181992)


--- trunk/Source/_javascript_Core/ChangeLog	2015-03-26 02:36:08 UTC (rev 181991)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-03-26 03:11:04 UTC (rev 181992)
@@ -1,3 +1,13 @@
+2015-03-25  Andy Estes  <[email protected]>
+
+        [Cocoa] RemoteInspectorXPCConnection::deserializeMessage() leaks a NSDictionary under Objective-C GC
+        https://bugs.webkit.org/show_bug.cgi?id=143068
+
+        Reviewed by Dan Bernstein.
+
+        * inspector/remote/RemoteInspectorXPCConnection.mm:
+        (Inspector::RemoteInspectorXPCConnection::deserializeMessage): Used RetainPtr::autorelease(), which does the right thing under GC.
+
 2015-03-25  Filip Pizlo  <[email protected]>
 
         Use JITCompilationCanFail in more places, and make the fail path of JITCompilationMustSucceed a crash instead of attempting GC

Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorXPCConnection.mm (181991 => 181992)


--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorXPCConnection.mm	2015-03-26 02:36:08 UTC (rev 181991)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorXPCConnection.mm	2015-03-26 03:11:04 UTC (rev 181992)
@@ -31,6 +31,7 @@
 #import <Foundation/Foundation.h>
 #import <wtf/Assertions.h>
 #import <wtf/Ref.h>
+#import <wtf/RetainPtr.h>
 #import <wtf/spi/darwin/XPCSPI.h>
 
 #if __has_include(<CoreFoundation/CFXPCBridge.h>)
@@ -121,9 +122,9 @@
         return nil;
     }
 
-    NSDictionary *dictionary = static_cast<NSDictionary *>(_CFXPCCreateCFObjectFromXPCMessage(xpcDictionary));
+    RetainPtr<CFDictionaryRef> dictionary = adoptCF((CFDictionaryRef)_CFXPCCreateCFObjectFromXPCMessage(xpcDictionary));
     ASSERT_WITH_MESSAGE(dictionary, "Unable to deserialize xpc message");
-    return [dictionary autorelease];
+    return (NSDictionary *)dictionary.autorelease();
 }
 
 void RemoteInspectorXPCConnection::handleEvent(xpc_object_t object)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to