diff --git a/lib/tasks/task.js b/lib/tasks/task.js index 7a99493d..6c2434f9 100644 --- a/lib/tasks/task.js +++ b/lib/tasks/task.js @@ -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); } /**