fix crash if a sound is played, copied, and then the parent is given over
to RageSoundManager; don't think this ever actually happens
This commit is contained in:
@@ -98,6 +98,16 @@ void RageSoundManager::Update(float delta)
|
||||
if( !(*it)->IsPlaying() )
|
||||
ToDelete.insert( *it );
|
||||
|
||||
/* Don't delete any sounds that are the parent of another sound. Always delete
|
||||
* child sounds first. */
|
||||
for( it = owned_sounds.begin(); it != owned_sounds.end(); ++it )
|
||||
if( (*it)->GetOriginal() != (*it) ) // child
|
||||
{
|
||||
set<RageSound *>::iterator parent = ToDelete.find( (*it)->GetOriginal() );
|
||||
if( parent != ToDelete.end() )
|
||||
ToDelete.erase( parent );
|
||||
}
|
||||
|
||||
for( it = ToDelete.begin(); it != ToDelete.end(); ++it )
|
||||
owned_sounds.erase( *it );
|
||||
g_SoundManMutex.Unlock(); /* finished with owned_sounds */
|
||||
|
||||
Reference in New Issue
Block a user