child tasks must remove reference to parent on kill or else entangled parent-child tasks will not be gc'ed

This commit is contained in:
Dave Horton
2022-02-01 11:00:12 -05:00
parent 36683dc151
commit 2329f0cda0

View File

@@ -62,7 +62,9 @@ class Task extends Emitter {
kill(cs) {
if (this.cs && !this.cs.isConfirmCallSession) this.logger.debug(`${this.name} is being killed`);
this._killInProgress = true;
// no-op
/* remove reference to parent task or else entangled parent-child tasks will not be gc'ed */
setImmediate(() => this.parentTask = null);
}
/**