diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 04:57:14 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 04:57:14 +0000 |
commit | 666ecd28cc344446d27d8748a21dfa3788e5462b (patch) | |
tree | b49b6e4f5adba00c1092bb12905c353b91ca1b13 /chrome/browser/gtk | |
parent | ca13d804c304a61711352044022971ec39f9d4f8 (diff) | |
download | chromium_src-666ecd28cc344446d27d8748a21dfa3788e5462b.zip chromium_src-666ecd28cc344446d27d8748a21dfa3788e5462b.tar.gz chromium_src-666ecd28cc344446d27d8748a21dfa3788e5462b.tar.bz2 |
Linux: Delay the deletion of the RWHVGtk object.
This object may be deleted within a signal handler for its widget, which causes a DCHECK. Fix by using MessageLoop::DeleteSoon() instead.
BUG=http://www.crbug.com/11847
TEST=Open browser, navigate to www.google.com. Navigate to www.yahoo.com. This will delete the old RWHV. It shouldn't crash.
Review URL: http://codereview.chromium.org/113316
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16039 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 16 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.h | 5 |
2 files changed, 2 insertions, 19 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 5a04c61..bf441a5 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -273,8 +273,7 @@ BrowserWindowGtk::BrowserWindowGtk(Browser* browser) : browser_(browser), // TODO(port): make this a pref. custom_frame_(false), - full_screen_(false), - method_factory_(this) { + full_screen_(false) { window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); SetWindowIcon(); SetGeometryHints(); @@ -783,18 +782,7 @@ gboolean BrowserWindowGtk::OnGtkAccelerator(GtkAccelGroup* accel_group, GdkModifierType modifier, BrowserWindowGtk* browser_window) { int command_id = GetCommandId(keyval, modifier); - // We have to delay certain commands that may try to destroy widgets to which - // GTK is currently holding a reference. (For now the only such command is - // tab closing.) GTK will hold a reference on the RWHV widget when the - // event came through on that widget but GTK focus was elsewhere. - if (IDC_CLOSE_TAB == command_id) { - MessageLoop::current()->PostTask(FROM_HERE, - browser_window->method_factory_.NewRunnableMethod( - &BrowserWindowGtk::ExecuteBrowserCommand, - command_id)); - } else { - browser_window->ExecuteBrowserCommand(command_id); - } + browser_window->ExecuteBrowserCommand(command_id); return TRUE; } diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h index cb6e0d5..f292cdf 100644 --- a/chrome/browser/gtk/browser_window_gtk.h +++ b/chrome/browser/gtk/browser_window_gtk.h @@ -9,7 +9,6 @@ #include "base/gfx/rect.h" #include "base/scoped_ptr.h" -#include "base/task.h" #include "base/timer.h" #include "chrome/browser/browser_window.h" #include "chrome/browser/tabs/tab_strip_model.h" @@ -187,10 +186,6 @@ class BrowserWindowGtk : public BrowserWindow, // The container for info bars. Always non-NULL. scoped_ptr<InfoBarContainerGtk> infobar_container_; - // When it goes out of scope during our destruction, |method_factory_| will - // cancel its pending tasks (which depend on us still existing). - ScopedRunnableMethodFactory<BrowserWindowGtk> method_factory_; - // The timer used to update frames for the Loading Animation. base::RepeatingTimer<BrowserWindowGtk> loading_animation_timer_; |