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);