fix: Properly track session.json debounce timer for cleanup

- Update session.sessionJsonDebounceTimer when creating new timers
- Clear timer reference after callback execution
- Remove incorrect initial null assignment
- Fixes memory leak where timers continued after session cleanup

The bug occurred because the timer ID was only stored in a local variable,
preventing proper cleanup during session termination.
This commit is contained in:
Peter Steinberger 2025-07-01 11:10:26 +01:00
parent bb272ce821
commit b515d70de7

View file

@ -818,7 +818,7 @@ export class PtyManager extends EventEmitter {
// Clear the timer reference after execution
session.sessionJsonDebounceTimer = null;
}, 100);
// Update the session's timer reference
session.sessionJsonDebounceTimer = debounceTimer;
}