Clear bitmap timeout on dispose

This commit is contained in:
Daniel Imms
2018-09-17 07:48:05 -07:00
parent 94b20d40bf
commit d9ec47ab7a
3 changed files with 12 additions and 1 deletions
+1
View File
@@ -51,6 +51,7 @@ export abstract class BaseRenderLayer implements IRenderLayer {
public dispose(): void {
this._container.removeChild(this._canvas);
this._charAtlas.dispose();
}
private _initCanvas(): void {
+4 -1
View File
@@ -4,10 +4,13 @@
*/
import { IGlyphIdentifier } from './Types';
import { IDisposable } from 'xterm';
export default abstract class BaseCharAtlas {
export default abstract class BaseCharAtlas implements IDisposable {
private _didWarmUp: boolean = false;
public dispose(): void { }
/**
* Perform any work needed to warm the cache before it can be used. May be called multiple times.
* Implement _doWarmUp instead if you only want to get called once.
+7
View File
@@ -120,6 +120,13 @@ export default class DynamicCharAtlas extends BaseCharAtlas {
// document.body.appendChild(this._cacheCanvas);
}
public dispose(): void {
if (this._bitmapCommitTimeout !== null) {
window.clearTimeout(this._bitmapCommitTimeout);
this._bitmapCommitTimeout = null;
}
}
public beginFrame(): void {
this._drawToCacheCount = 0;
}