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
- is duplicated by
-
QTBUG-54667 When drag&drop operation gets interrupted QDrag object doesn't get deleted in QListWidget
-
- Closed
-