Closed abrownsword closed 5 years ago
I’ve looked at it a bit more, and what I would like to see is a us_loop_deintegrate(), or some such function. It should do the work done by the atexit, and disable the code in the atexit. This would allow your approach of doing tear down during atexit, while allowing program architectures that prefer to avoid atexit to still shut down cleanly.
We can work on the name but yes that could probably be added.
This should be solved now - if you create a loop with default hint then freeing it will not run or delete it, that becomes your problem.
You also don't need to call integrate
I'm using the us_loop_integrate() function to use uWS with my own event loop, but during the exit sequence us_loop_free() calls uv_run(). This is a surprising behaviour -- should we really be re-running the event loop during exit (when stuff has already largely been torn down), especially if its not your own event loop?