Web Inspector: Crash closing a related tab with Web Inspector open while page is...
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 May 2015 03:55:15 +0000 (03:55 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 May 2015 03:55:15 +0000 (03:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145488

Reviewed by Alexey Proskuryakov.

* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::~WebInspector):
Ensure, no matter how we close, that we have invalidated the
frontend connection of which we are the client.

(WebKit::WebInspector::createInspectorPage):
This member variable will never be null.

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebInspector.cpp
Source/WebKit2/WebProcess/WebPage/WebInspector.h

index 5021ae3eea9c8c1759787a78637a8e95da7007cc..6db9a29af115542bcb62a19f065fc78ea40d15ff 100644 (file)
@@ -1,3 +1,19 @@
+2015-05-29  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Crash closing a related tab with Web Inspector open while page is refreshing
+        https://bugs.webkit.org/show_bug.cgi?id=145488
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebProcess/WebPage/WebInspector.h:
+        * WebProcess/WebPage/WebInspector.cpp:
+        (WebKit::WebInspector::~WebInspector):
+        Ensure, no matter how we close, that we have invalidated the
+        frontend connection of which we are the client.
+
+        (WebKit::WebInspector::createInspectorPage):
+        This member variable will never be null.
+
 2015-05-29  Andreas Kling  <akling@apple.com>
 
         [iOS] When bouncing back from max pinch zoom scale, scaleChangeRate should be 0.
index 5afaee3e963858a9fe7c14e2d67c7647e25e6ef2..1ea912875c7a4c89820277c40a36a4d92d5022fe 100644 (file)
@@ -68,12 +68,15 @@ WebInspector::WebInspector(WebPage* page)
 {
 }
 
+WebInspector::~WebInspector()
+{
+    if (m_frontendConnection)
+        m_frontendConnection->invalidate();
+}
+
 // Called from WebInspectorClient
 void WebInspector::createInspectorPage(bool underTest)
 {
-    if (!m_page)
-        return;
-
 #if OS(DARWIN)
     mach_port_t listeningPort;
     mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort);
index ed85c909b292aafa9c943fec4a4e4e1b4425bc29..74eb7eabae3dff1dc9ea6167be66eec24d00b799 100644 (file)
@@ -91,6 +91,7 @@ private:
     friend class WebInspectorClient;
 
     explicit WebInspector(WebPage*);
+    virtual ~WebInspector();
 
     bool canAttachWindow();