@@ -57,6 +57,11 @@ export class ConnectionManager {
|
||||
connection.disconnect()
|
||||
delete this.connections[hash]
|
||||
}
|
||||
|
||||
public closeAllConnections() {
|
||||
Object.keys(this.connections)
|
||||
.forEach(hash => this.removeConnection(hash))
|
||||
}
|
||||
}
|
||||
|
||||
class UpdateNotifier {
|
||||
|
||||
@@ -30,6 +30,11 @@ function createWindow () {
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('close', function () {
|
||||
connectionManager.closeAllConnections()
|
||||
})
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
|
||||
Reference in New Issue
Block a user