fix: logger error after closing in mac in dev mod (Error: Cannot call write after a stream was destroyed)

This commit is contained in:
linonetwo 2024-01-03 22:45:25 +08:00
parent f8236fa6d3
commit 6287fe49fa
2 changed files with 12 additions and 2 deletions

View file

@ -15,7 +15,7 @@ import { MainChannel } from '@/constants/channels';
import { isTest } from '@/constants/environment';
import { container } from '@services/container';
import { initRendererI18NHandler } from '@services/libs/i18n';
import { logger } from '@services/libs/log';
import { destroyLogger, logger } from '@services/libs/log';
import { buildLanguageMenu } from '@services/menu/buildLanguageMenu';
import { bindServiceAndProxy } from '@services/libs/bindServiceAndProxy';
@ -179,13 +179,13 @@ app.on(
wikiService.stopAllWiki(),
windowService.clearWindowsReference(),
]);
destroyLogger();
app.exit(0);
},
);
app.on('quit', () => {
uninstall?.uninstall();
logger.info('App quit');
logger.close();
});
if (!isTest) {