Skip to content

Commit

Permalink
wasm: fix drop of small files
Browse files Browse the repository at this point in the history
On drop, close the file after write before sending the drop
event to make sure file content is flushed to to the
file system.

Task-number: QTBUG-128855
Change-Id: Ide14bfebbdef07eee03ae1bd19d394da537ab123
Reviewed-by: Piotr Wierciński <[email protected]>
(cherry picked from commit 0a37f03)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
(cherry picked from commit 77aa664)
  • Loading branch information
Morten Sørvig authored and Qt Cherry-pick Bot committed Sep 19, 2024
1 parent 0fa94a6 commit 0c2dd5e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/plugins/platforms/wasm/qwasmdom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0c2dd5e

Please sign in to comment.