Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit d452437

Browse files
small comments fixing
1 parent ba4d17a commit d452437

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/serialmonitor/outputBuffer.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import * as vscode from "vscode";
66

77
export class BufferedOutputChannel implements vscode.Disposable {
88
private _buffer: string[];
9-
private timer: NodeJS.Timer;
9+
private _timer: NodeJS.Timer;
1010
private _lastFlushTime: number;
1111

12-
public constructor(private outputCallback: (value: string) => void, private flushIntervalMs: number) {
12+
public constructor(private readonly outputCallback: (value: string) => void, private readonly flushIntervalMs: number) {
1313
this._buffer = [];
14-
this.timer = setInterval(() => this.tryFlush(), this.flushIntervalMs);
14+
this._timer = setInterval(() => this.tryFlush(), this.flushIntervalMs);
1515
this._lastFlushTime = Number.NEGATIVE_INFINITY;
1616
}
1717

@@ -24,7 +24,8 @@ export class BufferedOutputChannel implements vscode.Disposable {
2424
}
2525

2626
public dispose() {
27-
clearInterval(this.timer);
27+
this.tryFlush();
28+
clearInterval(this._timer);
2829
}
2930

3031
private add(value: string) {

0 commit comments

Comments
 (0)