This commit is contained in:
Johannes Rieken
2017-03-22 11:26:48 +01:00
parent c5d44858ff
commit 1f13773092

View File

@@ -62,12 +62,8 @@ export class BoundModelReferenceCollection {
}
private _cleanup(): void {
let diff = this._length - this._maxLength;
let i: number;
for (i = 0; i < this._data.length && diff > 0; i++) {
diff -= this._data[i].length;
this._data[i].dispose();
i -= 1;
while (this._length > this._maxLength) {
this._data[0].dispose();
}
}
}