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
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ export class NativeMessagingHost {
}

destroy() {
if (!this.connected) return
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If destroy() is called twice, this will still attempt to send an IPC to this.sender. I'll fix this up after merging.

this.connected = false
if (this.process) {
this.process.kill()
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-chrome-extensions/src/renderer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const injectExtensionAPIs = () => {
receive(message)
}
ipcRenderer.on(`crx-native-msg-${connectionId}`, onMessage)
ipcRenderer.once(`crx-native-msg-${connectNative}-disconnect`, () => {
ipcRenderer.once(`crx-native-msg-${connectionId}-disconnect`, () => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, good catch!

ipcRenderer.off(`crx-native-msg-${connectionId}`, onMessage)
disconnect()
})
Expand Down