Index: desktop.cpp =================================================================== --- desktop.cpp (revision 40979) +++ desktop.cpp (working copy) @@ -506,24 +506,29 @@ InitDragDrop(); } + +DesktopShellView::~DesktopShellView() +{ + if (FAILED(RevokeDragDrop(_hwnd))) + assert(0); +} + + bool DesktopShellView::InitDragDrop() { CONTEXT("DesktopShellView::InitDragDrop()"); - _pDropTarget = new DesktopDropTarget(_hwnd); + DesktopDropTarget * pDropTarget = new DesktopDropTarget(_hwnd); - if (!_pDropTarget) + if (!pDropTarget) return false; - _pDropTarget->AddRef(); + pDropTarget->AddRef(); - if (FAILED(RegisterDragDrop(_hwnd, _pDropTarget))) { - _pDropTarget->Release(); - _pDropTarget = NULL; + if (FAILED(RegisterDragDrop(_hwnd, pDropTarget))) { + pDropTarget->Release(); return false; } - else - _pDropTarget->Release(); FORMATETC ftetc; @@ -532,7 +537,8 @@ ftetc.tymed = TYMED_HGLOBAL; ftetc.cfFormat = CF_HDROP; - _pDropTarget->AddSuportedFormat(ftetc); + pDropTarget->AddSuportedFormat(ftetc); + pDropTarget->Release(); return true; } Index: desktop.h =================================================================== --- desktop.h (revision 40979) +++ desktop.h (working copy) @@ -170,6 +170,7 @@ typedef ExtContextMenuHandlerT super; DesktopShellView(HWND hwnd, IShellView* pShellView); + ~DesktopShellView(); bool InitDragDrop(); @@ -186,7 +187,6 @@ void refresh(); - DesktopDropTarget* _pDropTarget; HWND _hwndListView; int _icon_algo; };