Fix JS error on app quit (#377)

This was a rare race condition during app shutdown where a 'wt-'
message would be sent from the hidden webtorrent window to the main
window after the main window was already closed.

Fixes #373
This commit is contained in:
Feross Aboukhadijeh
2016-04-10 18:50:00 -07:00
parent 4c4caba002
commit c98f3cd040
2 changed files with 5 additions and 1 deletions

View File

@@ -72,6 +72,10 @@ function createWebTorrentHiddenWindow () {
win.hide()
}
})
win.once('closed', function () {
windows.webtorrent = null
})
}
function createMainWindow () {