summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Sørvig <[email protected]>2024-09-18 10:48:53 +0200
committerMorten Johan Sørvig <[email protected]>2024-09-19 13:17:22 +0000
commit0a37f038bfd7e18d9538dde8212a6c323eb4e70f (patch)
treea15aa1cc1ab11ecdd60d84327d3d6e4a6ce0fb1e
parent47b9251de1d722674fd08fe907dff09a0f8ae353 (diff)
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 <[email protected]>
-rw-r--r--src/plugins/platforms/wasm/qwasmdom.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/platforms/wasm/qwasmdom.cpp b/src/plugins/platforms/wasm/qwasmdom.cpp
index 96790ca71f3..b6f6be898ec 100644
--- a/src/plugins/platforms/wasm/qwasmdom.cpp
+++ b/src/plugins/platforms/wasm/qwasmdom.cpp
@@ -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;