MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / cleanup

Method cleanup

source code/utils/ShellCommand.ts:370–383  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

368 }
369
370 cleanup(): void {
371 this.#stdoutWrapper?.cleanup()
372 this.#stderrWrapper?.cleanup()
373 this.taskOutput.clear()
374 // Must run before nulling #abortSignal — #cleanupListeners() calls
375 // removeEventListener on it. Without this, a kill()+cleanup() sequence
376 // crashes: kill() queues #handleExit as a microtask, cleanup() nulls
377 // #abortSignal, then #handleExit runs #cleanupListeners() on the null ref.
378 this.#cleanupListeners()
379 // Release references to allow GC of ChildProcess internals and AbortController chain
380 this.#childProcess = null!
381 this.#abortSignal = null!
382 this.#onTimeoutCallback = undefined
383 }
384}
385
386/**

Callers

nothing calls this directly

Calls 3

#cleanupListenersMethod · 0.95
cleanupMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected