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.loadUrl('file://' + __dirname + '/index.html');
|
||||||
mainWindow.toggleDevTools();
|
mainWindow.toggleDevTools();
|
||||||
mainWindow.on('closed', function() {
|
mainWindow.on('closed', function() {
|
||||||
mainWindow = undefined;
|
delete mainWindow;
|
||||||
audioController.close();
|
audioController.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -47,14 +47,16 @@ app.on('ready', function () {
|
||||||
frame: false
|
frame: false
|
||||||
});
|
});
|
||||||
audioController.loadUrl('file://' + __dirname + '/audio.html');
|
audioController.loadUrl('file://' + __dirname + '/audio.html');
|
||||||
audioController.on('closed', function () { audioController = undefined; });
|
audioController.on('closed', function () { delete audioController; });
|
||||||
});
|
});
|
||||||
|
|
||||||
ipc.on('hide', function () {
|
ipc.on('hide', function () {
|
||||||
mainWindow.hide();
|
mainWindow.hide();
|
||||||
|
mainWindow.loadUrl('');
|
||||||
});
|
});
|
||||||
|
|
||||||
ipc.on('show', function () {
|
ipc.on('show', function () {
|
||||||
|
mainWindow.loadUrl('file://' + __dirname + '/index.html');
|
||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Reference in a new issue