Fix possible crash when closing the web inspector
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Nov 2014 06:11:49 +0000 (06:11 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Nov 2014 06:11:49 +0000 (06:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=138597
rdar://problem/18872688

Reviewed by Andreas Kling.

I reported a crash when reloading a page after inspecting it, possibly caused by
r172864. Speculatively fix by null-checking the main frame.

* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::~WebInspectorClient):

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp

index 1f2716c..0ccd740 100644 (file)
@@ -1,3 +1,17 @@
+2014-11-10  Simon Fraser  <simon.fraser@apple.com>
+
+        Fix possible crash when closing the web inspector
+        https://bugs.webkit.org/show_bug.cgi?id=138597
+        rdar://problem/18872688
+
+        Reviewed by Andreas Kling.
+        
+        I reported a crash when reloading a page after inspecting it, possibly caused by
+        r172864. Speculatively fix by null-checking the main frame.
+
+        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
+        (WebKit::WebInspectorClient::~WebInspectorClient):
+
 2014-11-10  Beth Dakin  <bdakin@apple.com>
 
         Whitespace action menus aren't working properly
index 5116ea0..254b75b 100644 (file)
@@ -74,7 +74,7 @@ WebInspectorClient::~WebInspectorClient()
         delete layer;
     }
 
-    if (m_paintRectOverlay)
+    if (m_paintRectOverlay && m_page->mainFrame())
         m_page->mainFrame()->pageOverlayController().uninstallPageOverlay(m_paintRectOverlay.get(), PageOverlay::FadeMode::Fade);
 }