Files
tk-electron-ai/main/ipc/system.js
2025-10-28 19:40:13 +08:00

18 lines
516 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 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 }