fix: clear free list on element update

This commit is contained in:
cha0s 2019-04-22 14:06:12 -05:00
parent 54c1009d24
commit 319822d93d

View File

@ -108,6 +108,10 @@ export class TextNode {
export class TextNodeRenderer extends Proton.BaseRender {
static clearFreeList() {
this._freeList = [];
}
static get freeList() {
if (!this._freeList) {
this._freeList = [];
@ -118,12 +122,12 @@ export class TextNodeRenderer extends Proton.BaseRender {
constructor(selector, stage) {
super();
this._body = new TextNode('');
this.freeList = [];
this.name = 'NodeRenderer';
this.queued = [];
this.stage = stage;
const promise = stage.findUiElement(selector);
promise.then((element) => {
this.constructor.clearFreeList();
this.parent = element;
});
}