mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-08-13 19:49:36 +00:00
fix: possible eventemitter memory leak delected
do: io.setMaxListeners(0);
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<PackageOutputPath>..\artifacts</PackageOutputPath>
|
||||
<PackageId>ElectronNET.CLI</PackageId>
|
||||
<Version>1.0.0</Version>
|
||||
<Version>1.0.1</Version>
|
||||
<Authors>Gregor Biswanger, Robert Muehsig</Authors>
|
||||
<Product>Electron.NET</Product>
|
||||
<Company />
|
||||
|
||||
@@ -4,6 +4,7 @@ var electron_1 = require("electron");
|
||||
module.exports = function (socket) {
|
||||
socket.on('registerIpcMainChannel', function (channel) { // 监听主程序注册
|
||||
electron_1.ipcMain.on(channel, function (event, args) { // 监听前端的推送
|
||||
console.log('ipc emit...', 'global.elesocket', global.elesocket.id, channel);
|
||||
global.elesocket.emit(channel, [event.preventDefault(), args]); // 发送到后端
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,11 +15,13 @@ app.on('ready', () => {
|
||||
|
||||
function startSocketApiBridge(port) {
|
||||
io = require('socket.io')(port);
|
||||
// yf add
|
||||
io.setMaxListeners(0);
|
||||
startAspCoreBackend(port);
|
||||
|
||||
io.on('connection', (socket) => {
|
||||
global.elesocket = socket;
|
||||
console.log('ASP.NET Core Application connected...', 'global.elesocket', global.elesocket.id);
|
||||
console.log('ASP.NET Core Application connected...', 'global.elesocket', global.elesocket.id, new Date());
|
||||
|
||||
appApi = require('./api/app')(socket, app);
|
||||
browserWindows = require('./api/browserWindows')(socket);
|
||||
|
||||
Reference in New Issue
Block a user