From a55d85c51c9a928218bcbde480a21c46f5714380 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 27 Nov 2015 12:12:08 +0100 Subject: [PATCH] - do not wait infinitely for termination of the Timidity++ process. This can lock up the engine indefinitely if the child process fails to exit. --- src/sound/music_midi_timidity.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sound/music_midi_timidity.cpp b/src/sound/music_midi_timidity.cpp index ec2843c79..dbc56cc56 100644 --- a/src/sound/music_midi_timidity.cpp +++ b/src/sound/music_midi_timidity.cpp @@ -713,11 +713,11 @@ BOOL SafeTerminateProcess(HANDLE hProcess, UINT uExitCode) if ( hRT ) { - // Must wait process to terminate to guarantee that it has exited... - WaitForSingleObject(hProcess, INFINITE); - + // Must wait for process to terminate to guarantee that it has exited... + DWORD res = WaitForSingleObject(hProcess, 1000); CloseHandle(hRT); - bSuccess = TRUE; + bSuccess = (res == WAIT_OBJECT_0); + dwErr = WAIT_TIMEOUT; } if ( !bSuccess )