Commit 97128d1c authored by berto@igalia.com's avatar berto@igalia.com

[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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bcf251c4
2013-08-13 Alberto Garcia <berto@igalia.com>
[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):
2013-08-13 Alberto Garcia <berto@igalia.com>
[GTK] Closing inspector window crashes wk
......
......@@ -1328,6 +1328,7 @@ static void webkit_web_view_dispose(GObject* object)
{
WebKitWebView* webView = WEBKIT_WEB_VIEW(object);
WebKitWebViewPrivate* priv = webView->priv;
WebCore::Page* corePagePtr = priv->corePage;
priv->disposing = TRUE;
......@@ -1340,6 +1341,12 @@ static void webkit_web_view_dispose(GObject* object)
// 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 @@ static void webkit_web_view_dispose(GObject* object)
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment