Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/updater-js-redownload-leak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
updater: patch
updater-js: patch
---

Calling `Update.download()` again now releases the bytes of the previous download instead of keeping them in memory until the webview is destroyed.
2 changes: 1 addition & 1 deletion plugins/updater/api-iife.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions plugins/updater/guest-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ class Update extends Resource {
rid: this.rid,
...options
})
// release the bytes of a previous download, which would otherwise be kept
// in memory until the webview is destroyed
await this.downloadedBytes?.close().catch(() => {})
this.downloadedBytes = new Resource(downloadedBytesRid)
}

Expand Down
Loading