Skip to content

Commit

Permalink
fix: activate the uv_loop on incoming IPC messages (#19467)
Browse files Browse the repository at this point in the history
* fix: activate the uv_loop on incoming IPC messages

* chore: guess at a fix for process not being defined
  • Loading branch information
trop[bot] authored and MarshallOfSound committed Jul 26, 2019
1 parent 7e6617b commit c0e9761
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/renderer/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ const ipcInternalEmitter = new EventEmitter()
v8Util.setHiddenValue(global, 'ipc', ipcEmitter)
v8Util.setHiddenValue(global, 'ipc-internal', ipcInternalEmitter)

const savedProcess = process
v8Util.setHiddenValue(global, 'ipcNative', {
onMessage (internal: boolean, channel: string, args: any[], senderId: number) {
const sender = internal ? ipcInternalEmitter : ipcEmitter
sender.emit(channel, { sender, senderId }, ...args)
savedProcess.activateUvLoop()
}
})

Expand Down

0 comments on commit c0e9761

Please sign in to comment.