diff --git a/assets/download-sandbox.html b/assets/download-sandbox.html
index ecb4886e..d8b26fad 100644
--- a/assets/download-sandbox.html
+++ b/assets/download-sandbox.html
@@ -12,6 +12,7 @@
link.href = url;
link.download = filename;
link.click();
+ URL.revokeObjectURL(url);
}
window.addEventListener("message", function(event) {
if (event.data.type === "download") {
diff --git a/src/domain/session/room/timeline/tiles/FileTile.js b/src/domain/session/room/timeline/tiles/FileTile.js
index 2891e8be..b2afd728 100644
--- a/src/domain/session/room/timeline/tiles/FileTile.js
+++ b/src/domain/session/room/timeline/tiles/FileTile.js
@@ -33,12 +33,14 @@ export class FileTile extends MessageTile {
const filename = content.body;
this._downloading = true;
this.emitChange("label");
+ let bufferHandle;
try {
- const bufferHandle = await this._mediaRepository.downloadAttachment(content);
+ bufferHandle = await this._mediaRepository.downloadAttachment(content);
this.platform.offerSaveBufferHandle(bufferHandle, filename);
} catch (err) {
this._error = err;
} finally {
+ bufferHandle?.dispose();
this._downloading = false;
}
this.emitChange("label");