Browse Source

fix(wallet): dereference window after closing

Dereference the main window after it has been closed in order to prevent
messages from being set to it after it when it no longer exists.
renovate/lint-staged-8.x
Tom Kirkpatrick 6 years ago
parent
commit
f95d015e5e
No known key found for this signature in database GPG Key ID: 72203A8EC5967EA8
  1. 6
      app/lib/zap/controller.js
  2. 4
      app/main.dev.js

6
app/lib/zap/controller.js

@ -112,6 +112,12 @@ class ZapController {
this.mainWindow.hide()
}
})
// Dereference the window object, usually you would store windows in an array if your app supports multi windows,
// this is the time when you should delete the corresponding element.
this.mainWindow.on('closed', () => {
this.mainWindow = null
})
}
// ------------------------------------

4
app/main.dev.js

@ -109,7 +109,9 @@ app.on('ready', () => {
event.preventDefault()
zap.terminate()
} else {
zap.mainWindow.forceClose = true
if (zap.mainWindow) {
zap.mainWindow.forceClose = true
}
}
})

Loading…
Cancel
Save