From 46733af348738264ff83bbc667674cef62c7e8e8 Mon Sep 17 00:00:00 2001 From: carlo-bramini Date: Wed, 13 Dec 2017 20:08:42 +0100 Subject: [PATCH] Fix crash to TCP server (WIN32). --- src/fluidsynth.c | 2 +- src/utils/fluid_sys.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fluidsynth.c b/src/fluidsynth.c index 81bd55d2..2fed90ea 100644 --- a/src/fluidsynth.c +++ b/src/fluidsynth.c @@ -736,7 +736,7 @@ int main(int argc, char** argv) cleanup: -#if !defined(MACINTOSH) && !defined(WIN32) +#if !defined(MACINTOSH) if (server != NULL) { /* if the user typed 'quit' in the shell, kill the server */ if (!interactive) { diff --git a/src/utils/fluid_sys.c b/src/utils/fluid_sys.c index d15d84eb..d1d39829 100644 --- a/src/utils/fluid_sys.c +++ b/src/utils/fluid_sys.c @@ -1161,8 +1161,10 @@ void delete_fluid_server_socket(fluid_server_socket_t *server_socket) if (server_socket->socket != INVALID_SOCKET) fluid_socket_close (server_socket->socket); - if (server_socket->thread) + if (server_socket->thread) { + fluid_thread_join(server_socket->thread); delete_fluid_thread (server_socket->thread); + } FLUID_FREE (server_socket);