diff --git a/renderer/api/lib/ipc.coffee b/renderer/api/lib/ipc.coffee index 2ef1290d9801..28b9a9692d04 100644 --- a/renderer/api/lib/ipc.coffee +++ b/renderer/api/lib/ipc.coffee @@ -6,6 +6,9 @@ class Ipc extends EventEmitter process.on 'ATOM_INTERNAL_MESSAGE', (args...) => @emit(args...) + window.addEventListener 'unload', (event) -> + process.removeAllListeners 'ATOM_INTERNAL_MESSAGE' + send: (args...) -> ipc.send('ATOM_INTERNAL_MESSAGE', 'message', args...)