summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorAndy Shaw <qt-info@nokia.com>2010-06-23 05:51:21 (GMT)
committerAndy Shaw <qt-info@nokia.com>2010-06-23 05:51:21 (GMT)
commit6cef89c6442d06934c3545919e6b8283b3d8d1a4 (patch)
treeecafe167d992b8c8f9c8818cb23722831eb7b253 /src/gui/kernel
parent25da7da1b5b454eae0b8080a97fd4a37d688aa54 (diff)
downloadQt-6cef89c6442d06934c3545919e6b8283b3d8d1a4.zip
Qt-6cef89c6442d06934c3545919e6b8283b3d8d1a4.tar.gz
Qt-6cef89c6442d06934c3545919e6b8283b3d8d1a4.tar.bz2
When a drag is finished with on Mac, then it should delete itself
On other platforms then when a drag is finished then it cleans up by calling setMimeData(0) and deleteLater() on the drag object, this didn't happen before on the Mac which meant it did not delete the QDrag objects until the parent of them was deleted thus taking up memory. Task-number: QTBUG-11613 Reviewed-by: Prasanth
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm2
-rw-r--r--src/gui/kernel/qdnd_mac.mm4
2 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index eec9699..5c90e2e 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -1587,6 +1587,8 @@ Qt::DropAction QDragManager::drag(QDrag *o)
}
}
}
+ o->setMimeData(0);
+ o->deleteLater();
return performedAction;
}
diff --git a/src/gui/kernel/qdnd_mac.mm b/src/gui/kernel/qdnd_mac.mm
index 189d535..844f5e3 100644
--- a/src/gui/kernel/qdnd_mac.mm
+++ b/src/gui/kernel/qdnd_mac.mm
@@ -675,6 +675,8 @@ Qt::DropAction QDragManager::drag(QDrag *o)
}
if (atleastOne){
DisposeDrag(dragRef);
+ o->setMimeData(0);
+ o->deleteLater();
return action;
}
}
@@ -682,6 +684,8 @@ Qt::DropAction QDragManager::drag(QDrag *o)
DragActions ret = kDragActionNothing;
GetDragDropAction(dragRef, &ret);
DisposeDrag(dragRef); //cleanup
+ o->setMimeData(0);
+ o->deleteLater();
return qt_mac_dnd_map_mac_default_action(ret);
}
DisposeDrag(dragRef); //cleanup