From 478a849e8d5a581482ca9149fb50a9ec7568d844 Mon Sep 17 00:00:00 2001 From: Cutls Date: Sun, 16 Jun 2019 01:34:49 +0900 Subject: [PATCH] Fix: error about RAM --- app/main/system.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/main/system.js b/app/main/system.js index f40bf77d..95f80b15 100644 --- a/app/main/system.js +++ b/app/main/system.js @@ -197,17 +197,17 @@ function system(mainWindow, dir, lang, dirname) { }); return true; }) - var cbTimer1; ipc.on('startmem', (e, arg) => { - cbTimer1 = setInterval(mems(e), 1000); - function mems(e) { - var mem = os.totalmem() - os.freemem(); - if (mainWindow) { - e.sender.webContents.send('memory', [mem, os.cpus()[0].model, os.totalmem()]); - } - } + event = e.sender + cbTimer1 = setInterval(mems, 1000); }); + function mems() { + var mem = os.totalmem() - os.freemem(); + if (mainWindow) { + event.webContents.send('memory', [mem, os.cpus()[0].model, os.totalmem()]); + } + } ipc.on('endmem', (e, arg) => { if (cbTimer1) { clearInterval(cbTimer1);