From 1398c8aed38b0d42e7081410ae1710858d335f7e Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 27 Feb 2010 17:48:25 +0000 Subject: Fix race condition with condition variable freed before it is signaled. Subversion-branch: /branches/opl-branch Subversion-revision: 1873 --- opl/opl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opl/opl.c b/opl/opl.c index 9e674530..6d0e16db 100644 --- a/opl/opl.c +++ b/opl/opl.c @@ -415,9 +415,10 @@ static void DelayCallback(void *_delay_data) SDL_LockMutex(delay_data->mutex); delay_data->finished = 1; - SDL_UnlockMutex(delay_data->mutex); SDL_CondSignal(delay_data->cond); + + SDL_UnlockMutex(delay_data->mutex); } void OPL_Delay(unsigned int ms) -- cgit v1.2.3