From 3fb6fc5c1e40083ea2d60558128e5796724338d7 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 4 Nov 2015 19:30:53 +0000 Subject: [PATCH] Better memory management --- src/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index 890db1f..f762f10 100644 --- a/src/main.js +++ b/src/main.js @@ -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(); });