mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Fix a crash when a Source stops playing.
--HG-- branch : minor
This commit is contained in:
@@ -103,9 +103,16 @@ void Pool::update()
|
||||
{
|
||||
thread::Lock lock(mutex);
|
||||
|
||||
std::vector<Source *> torelease;
|
||||
|
||||
for (const auto &i : playing)
|
||||
{
|
||||
if (!i.first->update())
|
||||
releaseSource(i.first);
|
||||
torelease.push_back(i.first);
|
||||
}
|
||||
|
||||
for (Source *s : torelease)
|
||||
releaseSource(s);
|
||||
}
|
||||
|
||||
int Pool::getSourceCount() const
|
||||
|
||||
Reference in New Issue
Block a user