Prevent infinite loop when destroying sources (issue #250)

This commit is contained in:
Bart van Strien
2011-09-26 23:21:53 +02:00
parent 05c2749760
commit caf46ad430
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -271,9 +271,9 @@ namespace openal
if(i != playing.end()) if(i != playing.end())
{ {
source->stopAtomic(); source->stopAtomic();
source->release();
available.push(i->second); available.push(i->second);
playing.erase(i++); playing.erase(i++);
source->release();
return true; return true;
} }
+2 -1
View File
@@ -65,7 +65,8 @@ namespace openal
Source::~Source() Source::~Source()
{ {
pool->stop(this); if (valid)
pool->stop(this);
alDeleteBuffers((type == TYPE_STATIC) ? 1 : MAX_BUFFERS, buffers); alDeleteBuffers((type == TYPE_STATIC) ? 1 : MAX_BUFFERS, buffers);
if (decoder) if (decoder)
decoder->release(); decoder->release();