diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 22:58:03 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 22:58:03 +0000 |
commit | 456e9b09d076bc129e4360ef75b547de383e62bf (patch) | |
tree | ccc776af66f48efd8afe1fd5e0b42ef0ea225a6f /chrome | |
parent | 514576a82dabb7f0769a0e1e5a3203edab56194e (diff) | |
download | chromium_src-456e9b09d076bc129e4360ef75b547de383e62bf.zip chromium_src-456e9b09d076bc129e4360ef75b547de383e62bf.tar.gz chromium_src-456e9b09d076bc129e4360ef75b547de383e62bf.tar.bz2 |
Fix a crash on XP when we drag a virtual file out of the browser and then close the window.
The fix is to have the TabContentsDragWin destructor destruct drag_source_ since it might be still used by the background dragging thread.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2811039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51446 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/tab_contents/tab_contents_drag_win.cc | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/chrome/browser/views/tab_contents/tab_contents_drag_win.cc b/chrome/browser/views/tab_contents/tab_contents_drag_win.cc index 54a16fa..d52134a 100644 --- a/chrome/browser/views/tab_contents/tab_contents_drag_win.cc +++ b/chrome/browser/views/tab_contents/tab_contents_drag_win.cc @@ -104,7 +104,6 @@ TabContentsDragWin::TabContentsDragWin(TabContentsViewWin* view) TabContentsDragWin::~TabContentsDragWin() { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); - DCHECK(!drag_source_.get()); DCHECK(!drag_drop_thread_.get()); } @@ -297,10 +296,6 @@ void TabContentsDragWin::DoDragging(const WebDropData& drop_data, image, gfx::Size(image.width(), image.height()), image_offset, &data); } - // Keep a local reference to drag_source_ in case that EndDragging is called - // before DoDragDrop returns. - scoped_refptr<WebDragSource> drag_source(drag_source_); - // We need to enable recursive tasks on the message loop so we can get // updates while in the system DoDragDrop loop. bool old_state = MessageLoop::current()->NestableTasksAllowed(); @@ -312,7 +307,7 @@ void TabContentsDragWin::DoDragging(const WebDropData& drop_data, // This works because WebDragSource::OnDragSourceDrop uses PostTask to // dispatch the actual event. - drag_source->set_effect(effect); + drag_source_->set_effect(effect); } void TabContentsDragWin::EndDragging(bool restore_suspended_state) { @@ -325,8 +320,6 @@ void TabContentsDragWin::EndDragging(bool restore_suspended_state) { if (restore_suspended_state) view_->drop_target()->set_suspended(old_drop_target_suspended_state_); - drag_source_ = NULL; - if (msg_hook) { AttachThreadInput(drag_out_thread_id, GetCurrentThreadId(), FALSE); UnhookWindowsHookEx(msg_hook); |