Changeset - r13430:0c51240dab8a
[Not reviewed]
master
0 1 0
smatz - 15 years ago 2009-11-02 12:12:13
smatz@openttd.org
(svn r17949) -Fix (r17776): unlock mutex before deleting it when creating drawing thread failed
1 file changed with 6 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/video/sdl_v.cpp
Show inline comments
 
@@ -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) {
 
				_draw_mutex->EndCritical();
 
				delete _draw_mutex;
 
			}
 
		}
 

	
 
		/* Free the mutex if we won't be able to use it. */
 
		if (!_draw_threaded) delete _draw_mutex;
 
	}
 

	
 
	DEBUG(driver, 1, "SDL: using %sthreads", _draw_threaded ? "" : "no ");
0 comments (0 inline, 0 general)