Fixed race condition in Source:play (thanks Boolsheet)

This commit is contained in:
Alex Szpakowski
2013-08-19 16:05:43 -03:00
parent acfce1bf47
commit f7ca9ef557
+3 -3
View File
@@ -118,11 +118,11 @@ int Pool::getMaxSources() const
bool Pool::play(Source *source, ALuint &out)
{
bool ok;
out = 0;
thread::Lock lock(mutex);
bool ok = true;
out = 0;
bool alreadyPlaying = findSource(source, out);
if (!alreadyPlaying)