Title: [165075] trunk/Source/_javascript_Core
Revision
165075
Author
[email protected]
Date
2014-03-04 14:15:16 -0800 (Tue, 04 Mar 2014)

Log Message

Web Inspector: Listen for the XPC_ERROR_CONNECTION_INVALID event to deref
https://bugs.webkit.org/show_bug.cgi?id=129697

Patch by Joseph Pecoraro <[email protected]> on 2014-03-04
Reviewed by Timothy Hatcher.

* inspector/remote/RemoteInspectorXPCConnection.mm:
(Inspector::RemoteInspectorXPCConnection::RemoteInspectorXPCConnection):
(Inspector::RemoteInspectorXPCConnection::handleEvent):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (165074 => 165075)


--- trunk/Source/_javascript_Core/ChangeLog	2014-03-04 21:38:05 UTC (rev 165074)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-03-04 22:15:16 UTC (rev 165075)
@@ -1,3 +1,14 @@
+2014-03-04  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Listen for the XPC_ERROR_CONNECTION_INVALID event to deref
+        https://bugs.webkit.org/show_bug.cgi?id=129697
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/remote/RemoteInspectorXPCConnection.mm:
+        (Inspector::RemoteInspectorXPCConnection::RemoteInspectorXPCConnection):
+        (Inspector::RemoteInspectorXPCConnection::handleEvent):
+
 2014-03-04  Mark Hahnenberg  <[email protected]>
 
         Merge API shims and JSLock

Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorXPCConnection.mm (165074 => 165075)


--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorXPCConnection.mm	2014-03-04 21:38:05 UTC (rev 165074)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorXPCConnection.mm	2014-03-04 22:15:16 UTC (rev 165075)
@@ -60,7 +60,7 @@
         handleEvent(object);
     });
 
-    // Balanced by deref when the xpc_connection receives XPC_ERROR.
+    // Balanced by deref when the xpc_connection receives XPC_ERROR_CONNECTION_INVALID.
     ref();
 
     xpc_connection_resume(m_connection);
@@ -122,17 +122,21 @@
 void RemoteInspectorXPCConnection::handleEvent(xpc_object_t object)
 {
     if (xpc_get_type(object) == XPC_TYPE_ERROR) {
-        std::lock_guard<std::mutex> lock(m_mutex);
-        if (m_client)
-            m_client->xpcConnectionFailed(this);
+        {
+            std::lock_guard<std::mutex> lock(m_mutex);
+            if (m_client)
+                m_client->xpcConnectionFailed(this);
 
-        m_closed = true;
-        m_client = nullptr;
-        closeOnQueue();
+            m_closed = true;
+            m_client = nullptr;
+            closeOnQueue();
+        }
 
-        // This is the last event we will ever receive from the connection.
-        // Balance the ref() in the constructor.
-        deref();
+        if (object == XPC_ERROR_CONNECTION_INVALID) {
+            // This is the last event we will ever receive from the connection.
+            // This balances the ref() in the constructor.
+            deref();
+        }
         return;
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to