MCPcopy
hub / github.com/claude-code-best/claude-code / cleanup

Method cleanup

src/utils/ShellCommand.ts:368–381  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

#cleanupListenersMethod · 0.95
cleanupMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected