+2011-09-26 Gustavo Noronha Silva <gustavo.noronha@collabora.com>
+
+ REGRESSION: Empathy crashes when switching theme
+ https://bugs.webkit.org/show_bug.cgi?id=68600
+
+ Reviewed by Martin Robinson.
+
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_set_scroll_adjustments): use the existing
+ set{Horizontal,Vertical}Adjustment functions, so the code is not
+ duplicated
+ (webkit_web_view_dispose): unset the adjustments during dispose,
+ to avoid late adjustment change notifications hitting the
+ adjustment watcher
+
2011-09-24 Adam Barth <abarth@webkit.org>
Always enable ENABLE(OFFLINE_WEB_APPLICATIONS)
return webkit_web_view_forward_context_menu_event(WEBKIT_WEB_VIEW(widget), event);
}
-#ifndef GTK_API_VERSION_2
static void setHorizontalAdjustment(WebKitWebView* webView, GtkAdjustment* adjustment)
{
// This may be called after the page has been destroyed, in which case we do nothing.
static_cast<WebKit::ChromeClient*>(page->chrome()->client())->adjustmentWatcher()->setVerticalAdjustment(adjustment);
}
+#ifndef GTK_API_VERSION_2
static GtkAdjustment* getHorizontalAdjustment(WebKitWebView* webView)
{
Page* page = core(webView);
#ifdef GTK_API_VERSION_2
static void webkit_web_view_set_scroll_adjustments(WebKitWebView* webView, GtkAdjustment* horizontalAdjustment, GtkAdjustment* verticalAdjustment)
{
- // This may be called after the page has been destroyed, in which case we do nothing.
- Page* page = core(webView);
- if (!page)
- return;
-
- WebKit::ChromeClient* client = static_cast<WebKit::ChromeClient*>(page->chrome()->client());
- client->adjustmentWatcher()->setHorizontalAdjustment(horizontalAdjustment);
- client->adjustmentWatcher()->setVerticalAdjustment(verticalAdjustment);
+ setHorizontalAdjustment(webView, horizontalAdjustment);
+ setVerticalAdjustment(webView, verticalAdjustment);
}
#endif
priv->disposing = TRUE;
+ // Make sure GtkAdjustmentWatcher won't be reacting to adjustment changes after the
+ // WebView is destroyed.
+ setHorizontalAdjustment(webView, 0);
+ setVerticalAdjustment(webView, 0);
+
// These smart pointers are cleared manually, because some cleanup operations are
// very sensitive to their value. We may crash if these are done in the wrong order.
priv->backForwardList.clear();