Index: chrome/browser/tab_contents/tab_contents.cc |
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc |
index 9832fa4e4ee2a04416310b7dafe004620ac67a19..bcbb09b652e0ea1151b62262de07ba7c9e429ff0 100644 |
--- a/chrome/browser/tab_contents/tab_contents.cc |
+++ b/chrome/browser/tab_contents/tab_contents.cc |
@@ -1904,6 +1904,13 @@ void TabContents::UpdateInspectorSettings(const std::wstring& raw_settings) { |
} |
void TabContents::Close(RenderViewHost* rvh) { |
+ // If we close the tab while we're in the middle of a drag, we'll crash. |
+ // Instead, cancel the drag and close it as soon as the drag ends. |
+ if (view()->IsDoingDrag()) { |
+ view()->CancelDragAndCloseTab(); |
+ return; |
+ } |
+ |
// Ignore this if it comes from a RenderViewHost that we aren't showing. |
if (delegate() && rvh == render_view_host()) |
delegate()->CloseContents(this); |