Closed shinayser closed 3 years ago
This is due to the second call to close
never completing. The result of onTimeout
(true
) is passed to the following then
, and then you call close
again.
Calling close
sends a "terminate" request to the runner, and waits for a response. Since the runner was killed by the first call to close
, that response never comes and the port waiting for it is keeping the isolate alive.
I'll make later calls to close
use the result of the first call.
Check this simple code:
This code works fine and it outputs:
Cool! But if you change the timeout duration from 3000 to 1000, it outputs:
...and the program keeps running. It never prints
Process finished with exit code 0
. Probably there is something leaking when the timeout methods get called.