Details
-
Task
-
Resolution: Incomplete
-
P4: Low
-
None
-
None
-
Qt 5.0.2, Windows 7 x64 SP1, VS 2010 SP1
Description
This code from
C:\Qt\Qt5.0.2\5.0.2\Src\qtbase\src\plugins\platforms\windows\qwindowswindow.cpp
void QWindowsWindow::registerDropSite()
{
#ifndef QT_NO_CLIPBOARD
- ifndef QT_NO_DRAGANDDROP
if (m_data.hwnd && !m_dropTarget) { m_dropTarget = new QWindowsOleDropTarget(window()); RegisterDragDrop(m_data.hwnd, m_dropTarget); CoLockObjectExternal(m_dropTarget, true, true); } - endif // !QT_NO_DRAGANDDROP
#endif // !QT_NO_CLIPBOARD
}
void QWindowsWindow::unregisterDropSite()
{
#ifndef QT_NO_CLIPBOARD
- ifndef QT_NO_DRAGANDDROP
if (m_data.hwnd && m_dropTarget) { m_dropTarget->Release(); CoLockObjectExternal(m_dropTarget, false, true); RevokeDragDrop(m_data.hwnd); m_dropTarget = 0; } - endif // !QT_NO_DRAGANDDROP
#endif // !QT_NO_CLIPBOARD
}
never frees m_dropTarget actually, because RevokeDragDrop(m_data.hwnd) doesn't call QWindowsOleDropTarget::Release(void) for some reasons I can't imagine: m_data.hwnd value looks ok, but some falks write on that: 'If the HWND is invalid then it doesn't decrement and the IDropTarget object will live on. MEMORY LEAK'. Maybe calling IsWindow() will show that the window is already dead here?
'
Explored running 'multiple' ActiveQt sample.