Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4887)

Unified Diff: chrome/browser/views/tabs/tab.cc

Issue 16246: CRASH at Tab::OnMouseReleased... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/tabs/tab.h ('k') | chrome/browser/views/tabs/tab_strip.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/tabs/tab.cc
===================================================================
--- chrome/browser/views/tabs/tab.cc (revision 7580)
+++ chrome/browser/views/tabs/tab.cc (working copy)
@@ -178,10 +178,14 @@
void Tab::OnMouseReleased(const views::MouseEvent& event, bool canceled) {
// Notify the drag helper that we're done with any potential drag operations.
// Clean up the drag helper, which is re-created on the next mouse press.
- delegate_->EndDrag(canceled);
+ // In some cases, ending the drag will schedule the tab for destruction; if
+ // so, bail immediately, since our members are already dead and we shouldn't
+ // do anything else except drop the tab where it is.
+ if (delegate_->EndDrag(canceled))
+ return;
- // Close tabs on middle click, but only if the button is released over the tab
- // (normal windows behavior is to discard presses of a UI element where the
+ // Close tab on middle click, but only if the button is released over the tab
+ // (normal windows behavior is to discard presses of a UI element where the
// releases happen off the element).
if (event.IsMiddleMouseButton() && HitTest(event.location()))
delegate_->CloseTab(this);
« no previous file with comments | « chrome/browser/views/tabs/tab.h ('k') | chrome/browser/views/tabs/tab_strip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698