Skip to content

Commit e1da277

Browse files
Fix memory leaks in XML conversion: ensure xmlStreamParser.destroy() is invoked during teardown and replace addListener with on for conversion events to avoid accumulating listeners.
🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent d848d3e commit e1da277

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

npm-app/src/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,6 +1348,8 @@ export class Client {
13481348
this.cancelCurrentInput()
13491349
this.currentOnChunk = undefined
13501350

1351+
xmlStreamParser.destroy()
1352+
13511353
const additionalMessages = prompt
13521354
? [
13531355
{ role: 'user' as const, content: prompt },

npm-app/src/display/markdown-renderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class MarkdownStreamRenderer {
101101
this.width = process.stdout.columns || this.width
102102
}
103103
// Use .once with bound handler tracker to avoid duplication
104-
process.stdout.addListener('resize', this.resizeHandler)
104+
process.stdout.on('resize', this.resizeHandler)
105105
}
106106
}
107107

0 commit comments

Comments
 (0)