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