wasm: fix drop of small files

On drop, close the file after write before sending the drop
event to make sure file content is flushed to to the
file system.

Pick-to: 6.7 6.8 6.8.0
Task-number: QTBUG-128855
Change-Id: Ide14bfebbdef07eee03ae1bd19d394da537ab123
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
This commit is contained in:
Morten Sørvig 2024-09-18 10:48:53 +02:00 committed by Morten Johan Sørvig
parent 47b9251de1
commit 0a37f038bf

View File

@ -181,10 +181,9 @@ void DataTransfer::toMimeDataWithFile(std::function<void(QMimeData *)> callback)
mimeContext->deref();
return;
}
if (file.write(fileContent) < 0) {
if (file.write(fileContent) < 0)
qWarning() << "Write failed";
file.close();
}
file.close();
mimeContext->deref();
});
break;