Changeset 47493 in webkit


Ignore:
Timestamp:
Aug 18, 2009 10:57:17 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-08-18 Jan Michael Alonzo <jmalonzo@webkit.org>

Reviewed by Oliver Hunt.

[Gtk] crash when closing page from javascript
https://bugs.webkit.org/show_bug.cgi?id=27439

Do not unref the WebView in ChromeClientGtk::closeWindowSoon
because (1) a create-web-view handler can return a NULL WebView,
(2) the created WebView is owned by its containing widget, and (3)
clients may not handle the close-web-view signal so this avoids
unreffing a WebView more than once.

  • WebCoreSupport/ChromeClientGtk.cpp: (WebKit::ChromeClient::closeWindowSoon):
  • webkit/webkitwebview.cpp: (webkit_web_view_class_init):
Location:
trunk/WebKit/gtk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/gtk/ChangeLog

    r47457 r47493  
     12009-08-18  Jan Michael Alonzo  <jmalonzo@webkit.org>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        [Gtk] crash when closing page from javascript
     6        https://bugs.webkit.org/show_bug.cgi?id=27439
     7
     8        Do not unref the WebView in ChromeClientGtk::closeWindowSoon
     9        because (1) a create-web-view handler can return a NULL WebView,
     10        (2) the created WebView is owned by its containing widget, and (3)
     11        clients may not handle the close-web-view signal so this avoids
     12        unreffing a WebView more than once.
     13
     14        * WebCoreSupport/ChromeClientGtk.cpp:
     15        (WebKit::ChromeClient::closeWindowSoon):
     16        * webkit/webkitwebview.cpp:
     17        (webkit_web_view_class_init):
     18
    1192009-08-18  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
    220
  • trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp

    r46344 r47493  
    216216void ChromeClient::closeWindowSoon()
    217217{
     218    // We may not have a WebView as create-web-view can return NULL.
     219    if (!m_webView)
     220        return;
     221
    218222    webkit_web_view_stop_loading(m_webView);
    219223
     
    227231    // But this gets cleared in Page's destructor anyway.
    228232    // webkit_web_view_set_group_name(m_webView, "");
    229     g_object_unref(m_webView);
    230233}
    231234
  • trunk/WebKit/gtk/webkit/webkitwebview.cpp

    r47322 r47493  
    12291229     * until the #WebKitWebView::web-view-ready signal is emitted.
    12301230     *
    1231      * The signal handlers should not try to deal with the reference
    1232      * count for the new #WebKitWebView. The widget to which the
    1233      * widget is added will handle that.
     1231     * The signal handlers should not try to deal with the reference count for
     1232     * the new #WebKitWebView. The widget to which the widget is added will
     1233     * handle that.
    12341234     *
    12351235     * Since 1.0.3
     
    12791279     * %FALSE to propagate the event furter
    12801280     *
    1281      * Emitted when closing a WebView is requested. This occurs when a call
    1282      * is made from JavaScript's window.close function.
     1281     * Emitted when closing a #WebKitWebView is requested. This occurs when a
     1282     * call is made from JavaScript's window.close function. The default
     1283     * signal handler does not do anything. It is the owner's responsibility
     1284     * to hide or delete the web view, if necessary.
    12831285     *
    12841286     * Since 1.1.11
Note: See TracChangeset for help on using the changeset viewer.