make reset async aware

This commit is contained in:
Jörg Breitbart
2021-02-25 19:04:37 +01:00
parent 6b57921567
commit b4635eddf3
5 changed files with 111 additions and 80 deletions
+5 -1
View File
@@ -48,9 +48,13 @@ export class DcsParser implements IDcsParser {
}
public reset(): void {
// force cleanup leftover handlers
if (this._active.length) {
this.unhook(false);
for (let j = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; j >= 0; --j) {
this._active[j].unhook(false);
}
}
this._stack.paused = false;
this._active = EMPTY_HANDLERS;
this._ident = 0;
}