Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix leaking streams (id from preload side) #590

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6964a69
fix-gui-messages
maidh91 Feb 1, 2025
b7e927a
sendSync
maidh91 Feb 1, 2025
b8fa376
revert tray
maidh91 Feb 1, 2025
0df9319
messagesClose
maidh91 Feb 1, 2025
6c4ffa8
messagesId
maidh91 Feb 1, 2025
c7c2672
fix this.messagesList.nextId
maidh91 Feb 1, 2025
4fb26c1
Merge branch 'main' of https://github.com/holepunchto/pear into fix-g…
maidh91 Feb 3, 2025
115da33
this.streams
maidh91 Feb 3, 2025
1fa39c3
fix warming reports
maidh91 Feb 3, 2025
bda8d95
rename to relay
maidh91 Feb 3, 2025
0712a3b
improve relay
maidh91 Feb 3, 2025
84aba13
typo
maidh91 Feb 3, 2025
fef53aa
rename to msg
maidh91 Feb 3, 2025
c5c1ac7
fix on evt
maidh91 Feb 3, 2025
95c363f
rename streamId
maidh91 Feb 3, 2025
8070fe0
move streamId inside
maidh91 Feb 3, 2025
b099944
ipcRenderer.once
maidh91 Feb 3, 2025
d67dc04
this.#streams
maidh91 Feb 3, 2025
82c5604
move relay to bottom
maidh91 Feb 3, 2025
4f82e5b
remove freelist
maidh91 Feb 3, 2025
274c1bb
update message null
maidh91 Feb 3, 2025
42f983d
reorder
maidh91 Feb 3, 2025
4f3d176
lint
maidh91 Feb 3, 2025
ecd3f7e
use Map
maidh91 Feb 3, 2025
3bef275
lint
maidh91 Feb 3, 2025
e1a1a41
streamAlloced
maidh91 Feb 3, 2025
0734dea
once
maidh91 Feb 3, 2025
8057a3d
fix-gui-streams
maidh91 Feb 3, 2025
e7ed3d7
item
maidh91 Feb 3, 2025
0298e64
default onData
maidh91 Feb 3, 2025
ccd0a4d
onData
maidh91 Feb 3, 2025
02bd535
ondata
maidh91 Feb 3, 2025
43b3b90
crypto.randomUUID
maidh91 Feb 3, 2025
79e5299
streamData', id
maidh91 Feb 3, 2025
c26e20a
fix ctx
maidh91 Feb 3, 2025
ba73666
handle on error
maidh91 Feb 4, 2025
4984d1e
relay as obj
maidh91 Feb 4, 2025
bf168ac
relay as obj
maidh91 Feb 4, 2025
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
Prev Previous commit
Next Next commit
revert tray
maidh91 committed Feb 1, 2025
commit b8fa3764661f19d846cf8fd26e707661d63ee9d7
16 changes: 8 additions & 8 deletions gui/preload.js
Original file line number Diff line number Diff line change
@@ -244,24 +244,24 @@ module.exports = class PearGUI extends ReadyResource {
}
})

const untray = async () => {
if (this.#untray) {
await this.#untray()
this.#untray = null
}
if (this.#untray) {
await this.#untray()
this.#untray = null
}
await untray()

const sub = ipc.messages({ type: 'pear/gui/tray/menuClick' })
sub.on('data', (msg) => listener(msg.key, opts))
await ipc.tray({ id, opts })

this.#untray = async () => {
sub.end()
sub.destroy()
await ipc.untray({ id })
}

return untray
return async () => {
await this.#untray()
this.#untray = null
}
}

exit = (code) => {