Better memory management
This commit is contained in:
parent
df7952fdcb
commit
3fb6fc5c1e
1 changed files with 4 additions and 2 deletions
|
@ -36,7 +36,7 @@ app.on('ready', function () {
|
|||
mainWindow.loadUrl('file://' + __dirname + '/index.html');
|
||||
mainWindow.toggleDevTools();
|
||||
mainWindow.on('closed', function() {
|
||||
mainWindow = undefined;
|
||||
delete mainWindow;
|
||||
audioController.close();
|
||||
});
|
||||
|
||||
|
@ -47,14 +47,16 @@ app.on('ready', function () {
|
|||
frame: false
|
||||
});
|
||||
audioController.loadUrl('file://' + __dirname + '/audio.html');
|
||||
audioController.on('closed', function () { audioController = undefined; });
|
||||
audioController.on('closed', function () { delete audioController; });
|
||||
});
|
||||
|
||||
ipc.on('hide', function () {
|
||||
mainWindow.hide();
|
||||
mainWindow.loadUrl('');
|
||||
});
|
||||
|
||||
ipc.on('show', function () {
|
||||
mainWindow.loadUrl('file://' + __dirname + '/index.html');
|
||||
mainWindow.show();
|
||||
});
|
||||
|
||||
|
|
Reference in a new issue