mirror of
https://github.com/love2d/love.git
synced 2026-08-21 21:15:09 +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);
|
thread::Lock lock(mutex);
|
||||||
|
|
||||||
|
std::vector<Source *> torelease;
|
||||||
|
|
||||||
for (const auto &i : playing)
|
for (const auto &i : playing)
|
||||||
|
{
|
||||||
if (!i.first->update())
|
if (!i.first->update())
|
||||||
releaseSource(i.first);
|
torelease.push_back(i.first);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Source *s : torelease)
|
||||||
|
releaseSource(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Pool::getSourceCount() const
|
int Pool::getSourceCount() const
|
||||||
|
|||||||
Reference in New Issue
Block a user