File tree Expand file tree Collapse file tree 3 files changed +393
-0
lines changed
Expand file tree Collapse file tree 3 files changed +393
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ import url from 'url';
4040import yargs from 'yargs' ;
4141import { hideBin } from 'yargs/helpers' ;
4242import i18n from './i18next.config' ;
43+ import ElectronMCPClient from './mcp-client' ;
4344import {
4445 addToPath ,
4546 ArtifactHubHeadlampPkg ,
@@ -131,6 +132,7 @@ const shouldCheckForUpdates = process.env.HEADLAMP_CHECK_FOR_UPDATES !== 'false'
131132
132133// make it global so that it doesn't get garbage collected
133134let mainWindow : BrowserWindow | null ;
135+ let mcpClient : ElectronMCPClient ;
134136
135137/**
136138 * `Action` is an interface for an action to be performed by the plugin manager.
@@ -1463,6 +1465,10 @@ function startElecron() {
14631465 if ( mainWindow ) {
14641466 mainWindow . removeAllListeners ( 'close' ) ;
14651467 }
1468+ // Cleanup MCP client
1469+ if ( mcpClient ) {
1470+ mcpClient . cleanup ( ) . catch ( console . error ) ;
1471+ }
14661472 } ) ;
14671473}
14681474
You can’t perform that action at this time.
0 commit comments