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

[Linux] QDrag is never release if aborted

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.6.2
    • None
    • Ubuntu 15.10

    Description

      The title says it all - a QDrag object will not be released if aborted/canceled, either by esc or by dropping on a place, not accepting drops (mouse cursor is "forbidden").

      One can observe this easily in the dragabletext example - just move drag variable as static and make it QPointer<QDrag>. Now on mouse move, before you create the QDrag print its value. It should be always 0x0, because the previous object is removed after the operation completes.
      And indeed that's the case as long as you don't hit esc or drop onto invalid location, then the address of the still alive QDrag is printed.

      This have much larger consequences then a memory leak - there is no way to know a previous drag-and-drop operation is still active or is completed. This is because exec (on Linux) will not block until completion. The only way to know prev. op finished is to monitor the lifetime of the QDrag object. Obviously if the object is not released this particular dnd functionality of the application will stop to function until the app is restarted.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-53990
          # Subject Branch Project Status CR V

          Activity

            People

              Unassigned Unassigned
              mnaydenov Mihail Naydenov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes