mirror of
https://github.com/love2d/love.git
synced 2026-08-12 16:40:57 +02:00
Fixed immortal Sources.
This commit is contained in:
@@ -106,9 +106,6 @@ namespace openal
|
||||
|
||||
// Insert into map of playing sources.
|
||||
playing.insert(std::pair<love::audio::Source *, ALuint>(source, s));
|
||||
|
||||
// Retain the source.
|
||||
source->retain();
|
||||
}
|
||||
UNLOCK(mutex);
|
||||
|
||||
@@ -124,7 +121,6 @@ namespace openal
|
||||
{
|
||||
available.push(s);
|
||||
playing.erase(source);
|
||||
source->release();
|
||||
}
|
||||
UNLOCK(mutex);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ namespace openal
|
||||
|
||||
Source::~Source()
|
||||
{
|
||||
stop();
|
||||
}
|
||||
|
||||
void Source::play()
|
||||
@@ -74,6 +75,7 @@ namespace openal
|
||||
alSourceStop(source);
|
||||
audible->stop(this);
|
||||
source = 0;
|
||||
pool->release(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,6 +115,12 @@ namespace openal
|
||||
|
||||
void Source::update()
|
||||
{
|
||||
if(isFinished())
|
||||
{
|
||||
stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if(audible != 0)
|
||||
audible->update(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user