From dc4b251dbd8aa17f2af6f0dfb84515bb461f8b32 Mon Sep 17 00:00:00 2001 From: smatz Date: Mon, 2 Nov 2009 12:12:13 +0000 Subject: (svn r17949) -Fix (r17776): unlock mutex before deleting it when creating drawing thread failed --- src/video/sdl_v.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index 15c3ef37d..a0fb3c6d6 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -507,10 +507,13 @@ void VideoDriver_SDL::MainLoop() _draw_continue = true; _draw_threaded = ThreadObject::New(&DrawSurfaceToScreenThread, NULL, &_draw_thread); - } - /* Free the mutex if we won't be able to use it. */ - if (!_draw_threaded) delete _draw_mutex; + /* Free the mutex if we won't be able to use it. */ + if (!_draw_threaded) { + _draw_mutex->EndCritical(); + delete _draw_mutex; + } + } } DEBUG(driver, 1, "SDL: using %sthreads", _draw_threaded ? "" : "no "); -- cgit v1.2.3-54-g00ecf