Android: Make memory handling in QClipboard consistent with iOS
On iOS we do deleteLater() on the mime data instead of deleting it directly, in case the application should happen to use the pointer again directly after setting it on the clipboard. Technically it would be a bug in the application, but using deleteLater() is safer and it's better to be consistent with iOS so that a buggy application crashes in the same places in both. Change-Id: I2996d6c7816a2f83615a43609f5be207aaa72c86 Task-number: QTBUG-41853 Reviewed-by: BogDan Vatra <bogdan@kde.org>
This commit is contained in:
parent
e4493c41b6
commit
9bbf08fcf3
@ -55,7 +55,8 @@ void QAndroidPlatformClipboard::setMimeData(QMimeData *data, QClipboard::Mode mo
|
||||
{
|
||||
Q_ASSERT(supportsMode(mode));
|
||||
QtAndroidClipboard::setClipboardText(data != 0 && data->hasText() ? data->text() : QString());
|
||||
delete data;
|
||||
if (data != 0)
|
||||
data->deleteLater();
|
||||
}
|
||||
|
||||
bool QAndroidPlatformClipboard::supportsMode(QClipboard::Mode mode) const
|
||||
|
Loading…
Reference in New Issue
Block a user