1
0
Fork 0

(svn r17949) -Fix (r17776): unlock mutex before deleting it when creating drawing thread failed

release/1.0
smatz 2009-11-02 12:12:13 +00:00
parent 44013ba889
commit dc4b251dbd
1 changed files with 6 additions and 3 deletions

View File

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