Clear bitmap timeout on dispose
This commit is contained in:
@@ -51,6 +51,7 @@ export abstract class BaseRenderLayer implements IRenderLayer {
|
|||||||
|
|
||||||
public dispose(): void {
|
public dispose(): void {
|
||||||
this._container.removeChild(this._canvas);
|
this._container.removeChild(this._canvas);
|
||||||
|
this._charAtlas.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private _initCanvas(): void {
|
private _initCanvas(): void {
|
||||||
|
|||||||
@@ -4,10 +4,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { IGlyphIdentifier } from './Types';
|
import { IGlyphIdentifier } from './Types';
|
||||||
|
import { IDisposable } from 'xterm';
|
||||||
|
|
||||||
export default abstract class BaseCharAtlas {
|
export default abstract class BaseCharAtlas implements IDisposable {
|
||||||
private _didWarmUp: boolean = false;
|
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.
|
* 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.
|
* Implement _doWarmUp instead if you only want to get called once.
|
||||||
|
|||||||
@@ -120,6 +120,13 @@ export default class DynamicCharAtlas extends BaseCharAtlas {
|
|||||||
// document.body.appendChild(this._cacheCanvas);
|
// document.body.appendChild(this._cacheCanvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public dispose(): void {
|
||||||
|
if (this._bitmapCommitTimeout !== null) {
|
||||||
|
window.clearTimeout(this._bitmapCommitTimeout);
|
||||||
|
this._bitmapCommitTimeout = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public beginFrame(): void {
|
public beginFrame(): void {
|
||||||
this._drawToCacheCount = 0;
|
this._drawToCacheCount = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user