mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 20:14:44 -07:00
fix: resolve lifecycle memory leaks by cleaning up listeners and root closures (#25049)
This commit is contained in:
@@ -704,7 +704,10 @@ export class ShellExecutionService {
|
||||
|
||||
const finalStrippedOutput = stripAnsi(combinedOutput).trim();
|
||||
const exitCode = code;
|
||||
const exitSignal = signal ? os.constants.signals[signal] : null;
|
||||
const exitSignal =
|
||||
signal && os.constants.signals
|
||||
? (os.constants.signals[signal] ?? null)
|
||||
: null;
|
||||
|
||||
const resultPayload: ShellExecutionResult = {
|
||||
rawOutput: Buffer.from(''),
|
||||
@@ -1503,4 +1506,16 @@ export class ShellExecutionService {
|
||||
signal: info.signal,
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the internal state of the ShellExecutionService.
|
||||
* This is intended for use in tests to ensure isolation.
|
||||
*/
|
||||
static resetForTest(): void {
|
||||
this.activePtys.clear();
|
||||
this.activeChildProcesses.clear();
|
||||
this.backgroundLogPids.clear();
|
||||
this.backgroundLogStreams.clear();
|
||||
this.backgroundProcessHistory.clear();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user