I can't remember the exact details at this point, but during hxcoro development we ran into a problem on cpp when integrating libuv. Roughly, after the program had successfully ran the runtime starts to tear down thread local stuff by running destructors and some gcc specific "on exit" callbacks in libuv. This caused a race with the hxcpp GC being unloaded causing a segfault on program exit.
I think we should start using std::quick_exit, both when the user calls Sys.exit and when the program completes gracefully. This will prevent the destructors of any thread local stuff being called, which is fine as we're about to exit anyway. If there is something we want to run we can use std::at_quick_exit.
I can't remember the exact details at this point, but during hxcoro development we ran into a problem on cpp when integrating libuv. Roughly, after the program had successfully ran the runtime starts to tear down thread local stuff by running destructors and some gcc specific "on exit" callbacks in libuv. This caused a race with the hxcpp GC being unloaded causing a segfault on program exit.
I think we should start using
std::quick_exit, both when the user callsSys.exitand when the program completes gracefully. This will prevent the destructors of any thread local stuff being called, which is fine as we're about to exit anyway. If there is something we want to run we can usestd::at_quick_exit.