Fixed: possible event listener memeory leak

This commit is contained in:
Molunerfinn 2018-11-01 23:42:20 +08:00
parent ca01d2c521
commit 1af9af74ce
3 changed files with 7 additions and 4 deletions

View File

@ -82,7 +82,7 @@
"lowdb": "^1.0.0", "lowdb": "^1.0.0",
"md5": "^2.2.1", "md5": "^2.2.1",
"melody.css": "^1.0.2", "melody.css": "^1.0.2",
"picgo": "^1.1.8", "picgo": "^1.1.10",
"qiniu": "^7.1.1", "qiniu": "^7.1.1",
"request": "^2.83.0", "request": "^2.83.0",
"request-promise": "^4.2.2", "request-promise": "^4.2.2",

View File

@ -70,6 +70,7 @@ const handleGetPluginList = (ipcMain, STORE_PATH, CONFIG_PATH) => {
list.push(obj) list.push(obj)
} }
event.sender.send('pluginList', list) event.sender.send('pluginList', list)
picgo.cmd.program.removeAllListeners()
}) })
} }
@ -81,6 +82,7 @@ const handlePluginInstall = (ipcMain, STORE_PATH, CONFIG_PATH) => {
event.sender.send('installSuccess', notice.body[0].replace(/picgo-plugin-/, '')) event.sender.send('installSuccess', notice.body[0].replace(/picgo-plugin-/, ''))
}) })
pluginHandler.install([`picgo-plugin-${msg}`]) pluginHandler.install([`picgo-plugin-${msg}`])
picgo.cmd.program.removeAllListeners()
}) })
} }
@ -92,6 +94,7 @@ const handlePluginUninstall = (ipcMain, STORE_PATH, CONFIG_PATH) => {
event.sender.send('installSuccess', notice.body[0].replace(/picgo-plugin-/, '')) event.sender.send('installSuccess', notice.body[0].replace(/picgo-plugin-/, ''))
}) })
pluginHandler.uninstall([`picgo-plugin-${msg}`]) pluginHandler.uninstall([`picgo-plugin-${msg}`])
picgo.cmd.program.removeAllListeners()
}) })
} }

View File

@ -6200,9 +6200,9 @@ performance-now@^2.1.0:
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
picgo@^1.1.8: picgo@^1.1.10:
version "1.1.9" version "1.1.10"
resolved "https://registry.yarnpkg.com/picgo/-/picgo-1.1.9.tgz#0fb495a49f83fee759391966aca7dc0d6e8feac9" resolved "https://registry.yarnpkg.com/picgo/-/picgo-1.1.10.tgz#a80ab4f95059e05d96e7bf9ecef9074202539f87"
dependencies: dependencies:
chalk "^2.4.1" chalk "^2.4.1"
commander "^2.17.0" commander "^2.17.0"