Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-30836

QWindowsOleDropTarget never gets freed from memory

    XMLWordPrintable

Details

    • Task
    • Resolution: Incomplete
    • P4: Low
    • None
    • None
    • Core: Plugins
    • 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

      1. 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); }
      2. endif // !QT_NO_DRAGANDDROP
        #endif // !QT_NO_CLIPBOARD
        }

      void QWindowsWindow::unregisterDropSite()
      {
      #ifndef QT_NO_CLIPBOARD

      1. 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; }
      2. 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            zandr Andrei Zakharov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes