Closed calebj0seph closed 2 years ago
Thanks, reproduced. The problem is actually with aliasing of the traversal array in an attempt to minimize GC -- I'll come up with a fix tonight.
Fixed in 0.12.3.
Thanks for fixing this so quickly! Really appreciated 😃
Consider the following:
The line
console.log('Terminated!')
will never execute asworld.terminate()
never resolves.This is currently breaking our application as we need to wait for the world to terminate before creating a new world when another page is loaded.
Seems like the bug is in
SimplePlan.finalize()
on line 82 and 90: https://github.com/LastOliveGames/becsy/blob/d97a10632dcd7df75cf5142da0c4e89d6161fdd6/src/planner.ts#L82;L90this.graph.traverse()
can return an empty array, meaning the lineif (!systems) return resolve()
never gets executed causing the promise to never resolve. Checkingif (!systems?.length) return resolve()
instead seems like it would fix the issue.