稳定测试版
This commit is contained in:
17
main/ipc/system.js
Normal file
17
main/ipc/system.js
Normal file
@@ -0,0 +1,17 @@
|
||||
// main/ipc/system.js
|
||||
const { ipcMain, dialog } = require('electron')
|
||||
|
||||
function registerSystemIpc() {
|
||||
ipcMain.removeHandler('manual-gc')
|
||||
ipcMain.handle('manual-gc', () => {
|
||||
if (global.gc) {
|
||||
global.gc()
|
||||
console.log('🧹 手动触发 GC 成功')
|
||||
} else {
|
||||
console.warn('⚠️ global.gc 不存在,请确认 --expose-gc')
|
||||
}
|
||||
})
|
||||
// 你也可以把 select-file 放这里(如果不想放 window.js)
|
||||
}
|
||||
|
||||
module.exports = { registerSystemIpc }
|
||||
Reference in New Issue
Block a user