summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-26 20:49:01 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-26 20:49:01 +0000
commit94da429847e30db396d4d0409a5ebe91f6bb68d6 (patch)
treeb3d5160ef7b4e9434502b5e15a84bbb3f0995cc8 /chrome/browser/gtk
parentde8d9e31b9851efdbd184a3121622e5cec168230 (diff)
downloadchromium_src-94da429847e30db396d4d0409a5ebe91f6bb68d6.zip
chromium_src-94da429847e30db396d4d0409a5ebe91f6bb68d6.tar.gz
chromium_src-94da429847e30db396d4d0409a5ebe91f6bb68d6.tar.bz2
Fix a corner case in tab dragging where we receive a drag-end signal before ever receiving a drag-motion signal. In this case we'd crash because dragged_tab_ isn't created yet.
BUG=12473 TEST=Open a browser with three tabs. Rapidly click on the first and third tabs. This should not cause the browser to crash. Review URL: http://codereview.chromium.org/113854 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16905 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc
index 0b86bb3..6550b3a 100644
--- a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc
+++ b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc
@@ -486,6 +486,12 @@ TabGtk* DraggedTabControllerGtk::GetTabMatchingDraggedContents(
}
bool DraggedTabControllerGtk::EndDragImpl(EndDragType type) {
+ // In gtk, it's possible to receive a drag-begin signal and an drag-end signal
+ // without ever getting a drag-motion signal. In this case, dragged_tab_ has
+ // never been created, so bail out.
+ if (!dragged_tab_.get())
+ return true;
+
// WARNING: this may be invoked multiple times. In particular, if deletion
// occurs after a delay (as it does when the tab is released in the original
// tab strip) and the navigation controller/tab contents is deleted before