Changeset 55245 in webkit
- Timestamp:
- Feb 25, 2010 10:18:02 AM (14 years ago)
- Location:
- trunk/WebKit/gtk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/gtk/ChangeLog
r55222 r55245 1 2010-02-25 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 2 3 Reviewed by Xan Lopez. 4 5 [Gtk] crashed when destroying 6 https://bugs.webkit.org/show_bug.cgi?id=31271 7 8 NULL-check the page before relaying the focus out event, since 9 this might happen when destroying the widget without destroying 10 its parent, and we currently crash. 11 12 * tests/testwebview.c: 13 (delayed_destroy): 14 (test_webkit_web_view_destroy): 15 (main): 16 * webkit/webkitwebview.cpp: 17 (webkit_web_view_focus_in_event): 18 1 19 2010-02-24 Krzysztof Kotlenga <pocek@users.sf.net> 2 20 -
trunk/WebKit/gtk/tests/testwebview.c
r55173 r55245 1 1 /* 2 2 * Copyright (C) 2008 Holger Hans Peter Freyther 3 * Copyright (C) 2009 Collabora Ltd.3 * Copyright (C) 2009, 2010 Collabora Ltd. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 227 227 } 228 228 229 gboolean delayed_destroy(gpointer data) 230 { 231 gtk_widget_destroy(GTK_WIDGET(data)); 232 g_main_loop_quit(loop); 233 return FALSE; 234 } 235 236 static void test_webkit_web_view_destroy() 237 { 238 GtkWidget* window; 239 GtkWidget* web_view; 240 241 window = gtk_window_new(GTK_WINDOW_TOPLEVEL); 242 web_view = webkit_web_view_new(); 243 244 gtk_container_add(GTK_CONTAINER(window), web_view); 245 246 gtk_widget_show_all(window); 247 248 loop = g_main_loop_new(NULL, TRUE); 249 250 g_signal_connect(window, "map-event", 251 G_CALLBACK(map_event_cb), loop); 252 g_main_loop_run(loop); 253 254 g_idle_add(delayed_destroy, web_view); 255 g_main_loop_run(loop); 256 257 gtk_widget_destroy(window); 258 } 259 229 260 int main(int argc, char** argv) 230 261 { … … 252 283 g_test_add_func("/webkit/webview/icon-uri", test_webkit_web_view_icon_uri); 253 284 g_test_add_func("/webkit/webview/adjustments", test_webkit_web_view_adjustments); 285 g_test_add_func("/webkit/webview/destroy", test_webkit_web_view_destroy); 254 286 255 287 return g_test_run (); -
trunk/WebKit/gtk/webkit/webkitwebview.cpp
r55150 r55245 7 7 * Copyright (C) 2008 Gustavo Noronha Silva <gns@gnome.org> 8 8 * Copyright (C) 2008 Nuanti Ltd. 9 * Copyright (C) 2008, 2009 Collabora Ltd.9 * Copyright (C) 2008, 2009, 2010 Collabora Ltd. 10 10 * Copyright (C) 2009 Igalia S.L. 11 11 * Copyright (C) 2009 Movial Creative Technologies Inc. … … 677 677 WebKitWebView* webView = WEBKIT_WEB_VIEW(widget); 678 678 679 core(webView)->focusController()->setActive(false); 680 core(webView)->focusController()->setFocused(false); 679 // We may hit this code while destroying the widget, and we might 680 // no longer have a page, then. 681 Page* page = core(webView); 682 if (page) { 683 page->focusController()->setActive(false); 684 page->focusController()->setFocused(false); 685 } 681 686 682 687 return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->focus_out_event(widget, event);
Note: See TracChangeset
for help on using the changeset viewer.