Title: [154014] trunk/Source/WebKit/gtk
Revision
154014
Author
[email protected]
Date
2013-08-13 11:50:45 -0700 (Tue, 13 Aug 2013)

Log Message

[GTK] Closing inspector window crashes wk
https://bugs.webkit.org/show_bug.cgi?id=110865

Reviewed by Carlos Garcia Campos.

The previous fix for the inspector window crash breaks some unit
tests. This one goes back to the original code and only moves the
actual deletion of priv->corePage to the end of the function.

* webkit/webkitwebview.cpp:
(webkit_web_view_dispose):

Modified Paths

Diff

Modified: trunk/Source/WebKit/gtk/ChangeLog (154013 => 154014)


--- trunk/Source/WebKit/gtk/ChangeLog	2013-08-13 18:07:00 UTC (rev 154013)
+++ trunk/Source/WebKit/gtk/ChangeLog	2013-08-13 18:50:45 UTC (rev 154014)
@@ -5,6 +5,20 @@
 
         Reviewed by Carlos Garcia Campos.
 
+        The previous fix for the inspector window crash breaks some unit
+        tests. This one goes back to the original code and only moves the
+        actual deletion of priv->corePage to the end of the function.
+
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_dispose):
+
+2013-08-13  Alberto Garcia  <[email protected]>
+
+        [GTK] Closing inspector window crashes wk
+        https://bugs.webkit.org/show_bug.cgi?id=110865
+
+        Reviewed by Carlos Garcia Campos.
+
         Deleting priv->corePage during the destruction of a webView will
         trigger the deletion of InspectorFrontendClient. However that
         object is supposed to handle the webView's destroy signal first in

Modified: trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp (154013 => 154014)


--- trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp	2013-08-13 18:07:00 UTC (rev 154013)
+++ trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp	2013-08-13 18:50:45 UTC (rev 154014)
@@ -1328,6 +1328,7 @@
 {
     WebKitWebView* webView = WEBKIT_WEB_VIEW(object);
     WebKitWebViewPrivate* priv = webView->priv;
+    WebCore::Page* corePagePtr = priv->corePage;
 
     priv->disposing = TRUE;
 
@@ -1340,6 +1341,12 @@
     // very sensitive to their value. We may crash if these are done in the wrong order.
     priv->backForwardList.clear();
 
+    if (priv->corePage) {
+        webkit_web_view_stop_loading(WEBKIT_WEB_VIEW(object));
+        core(priv->mainFrame)->loader()->detachFromParent();
+        priv->corePage = 0;
+    }
+
     if (priv->webSettings) {
         g_signal_handlers_disconnect_by_func(priv->webSettings.get(), reinterpret_cast<void*>(webkit_web_view_settings_notify), webView);
         priv->webSettings.clear();
@@ -1358,15 +1365,10 @@
 
     G_OBJECT_CLASS(webkit_web_view_parent_class)->dispose(object);
 
-    // We need to run the parent's dispose before destroying
-    // priv->corePage. Otherwise we're triggering the deletion of
+    // We need to run the parent's dispose before destroying the Page
+    // pointer. Otherwise we're triggering the deletion of
     // InspectorFrontendClient before it can clean up itself.
-    if (priv->corePage) {
-        webkit_web_view_stop_loading(WEBKIT_WEB_VIEW(object));
-        core(priv->mainFrame)->loader()->detachFromParent();
-        delete priv->corePage;
-        priv->corePage = 0;
-    }
+    delete corePagePtr;
 }
 
 static void webkit_web_view_finalize(GObject* object)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to