Add delay before stopping server
Let some time to print any exception trace before killing it.
This commit is contained in:
parent
cb1428223f
commit
f39de46a39
1 changed files with 10 additions and 0 deletions
|
@ -685,6 +685,8 @@ screen_finally_destroy_renderer:
|
|||
//SDL_DestroyRenderer(renderer);
|
||||
screen_finally_destroy_window:
|
||||
//SDL_DestroyWindow(window);
|
||||
// at least we hide it
|
||||
SDL_HideWindow(window);
|
||||
screen_finally_stop_and_join_controller:
|
||||
controller_stop(&controller);
|
||||
controller_join(&controller);
|
||||
|
@ -692,6 +694,14 @@ screen_finally_destroy_controller:
|
|||
controller_destroy(&controller);
|
||||
screen_finally_stop_decoder:
|
||||
SDLNet_TCP_Close(device_socket);
|
||||
|
||||
// let the server some time to print any exception trace before killing it
|
||||
struct timespec timespec = {
|
||||
.tv_sec = 0,
|
||||
.tv_nsec = 100000000, // 100ms
|
||||
};
|
||||
nanosleep(×pec, NULL); // ignore error
|
||||
|
||||
// kill the server before decoder_join() to wake up the decoder
|
||||
stop_server(server);
|
||||
decoder_join(&decoder);
|
||||
|
|
Loading…
Reference in a new issue