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

Function cleanup

src/hooks/useDiffInIDE.ts:234–251  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232 }
233
234 async function cleanup() {
235 // Careful to avoid race conditions, since this
236 // function can be called from multiple places.
237 if (isCleanedUp) {
238 return
239 }
240 isCleanedUp = true
241
242 // Don't fail if this fails
243 try {
244 await closeTabInIDE(tabName, ideClient)
245 } catch (e) {
246 logError(e as Error)
247 }
248
249 process.off('beforeExit', cleanup)
250 toolUseContext.abortController.signal.removeEventListener('abort', cleanup)
251 }
252
253 // Cleanup if the user hits esc to cancel the tool call - or on exit
254 toolUseContext.abortController.signal.addEventListener('abort', cleanup)

Callers 4

showDiffInIDEFunction · 0.70
startRecordingSessionFunction · 0.70
attemptConnectFunction · 0.70
useVoiceFunction · 0.70

Calls 3

closeTabInIDEFunction · 0.85
offMethod · 0.80
logErrorFunction · 0.50

Tested by

no test coverage detected