For completenes you could call uv_loop_close and free the loop at the end of main.