diff --git a/package-lock.json b/package-lock.json index f9a96970..03877de0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7290,9 +7290,9 @@ } }, "electron": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/electron/-/electron-12.0.5.tgz", - "integrity": "sha512-z0xYB3sPr0qZcDrHUUWqooPKe3yUzBDxQcgQe3f2TLstA84JIFXBoaIJCPh/fJW0+JdF/ZFVeK2SNgLhYtRV+Q==", + "version": "12.0.6", + "resolved": "https://registry.npmjs.org/electron/-/electron-12.0.6.tgz", + "integrity": "sha512-+fqhpdG6Fd6LzsizMdaSPC1I8tfsMT8/7fsYBgABED3hEWdus/rt6CQ54P3/EWZyQebtyHR6HXtlofUqKMV3KQ==", "dev": true, "requires": { "@electron/get": "^1.0.1", diff --git a/package.json b/package.json index 9defd220..9da28548 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "copy-webpack-plugin": "8.0.0", "css-loader": "^5.1.1", "devtron": "^1.4.0", - "electron": "^12.0.5", + "electron": "^12.0.6", "electron-builder": "^22.10.5", "electron-builder-squirrel-windows": "^22.10.5", "electron-debug": "^3.2.0", diff --git a/src/main/index.js b/src/main/index.js index 614e13ba..5697df66 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -326,6 +326,22 @@ function runApp() { newWindow.focus() }) + newWindow.on('close', () => { + newWindow.webContents.session.clearCache() + newWindow.webContents.session.clearStorageData({ + storages: [ + 'appcache', + 'cookies', + 'filesystem', + 'indexdb', + 'shadercache', + 'websql', + 'serviceworkers', + 'cachestorage' + ] + }) + }) + newWindow.on('closed', () => { // Remove closed window openedWindows = openedWindows.filter((window) => window !== newWindow) @@ -406,20 +422,6 @@ function runApp() { if (process.platform !== 'darwin') { app.quit() } - - mainWindow.webContents.session.clearCache() - mainWindow.webContents.session.clearStorageData({ - storages: [ - 'appcache', - 'cookies', - 'filesystem', - 'indexdb', - 'shadercache', - 'websql', - 'serviceworkers', - 'cachestorage' - ] - }) }) app.on('activate', () => {