Emit "exit" event for "process" when quitting.
This commit is contained in:
parent
909ff085ac
commit
d559275711
2 changed files with 8 additions and 0 deletions
|
@ -52,6 +52,10 @@ setImmediate ->
|
|||
detail: message
|
||||
buttons: ['OK']
|
||||
|
||||
# Emit 'exit' event on quit.
|
||||
require('app').on 'quit', ->
|
||||
process.emit 'exit'
|
||||
|
||||
# Load the RPC server.
|
||||
require './rpc-server.js'
|
||||
|
||||
|
|
|
@ -24,6 +24,10 @@ require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init.js')
|
|||
global.require = require
|
||||
global.module = module
|
||||
|
||||
# Emit the 'exit' event when page is unloading.
|
||||
window.addEventListener 'unload', ->
|
||||
process.emit 'exit'
|
||||
|
||||
# Set the __filename to the path of html file if it's file: or asar: protocol.
|
||||
if window.location.protocol in ['file:', 'asar:']
|
||||
pathname =
|
||||
|
|
Loading…
Reference in a new issue