hack to not confuse GetCopies no longer needed

This commit is contained in:
Glenn Maynard
2004-11-15 05:15:51 +00:00
parent 36e7a78ea6
commit 6e0a17d42c
-12
View File
@@ -96,18 +96,6 @@ void RageSoundManager::Update(float delta)
ToDelete.insert( *it );
}
/* Don't delete any sounds that are the parent of another sound. Always delete
* child sounds first. Otherwise, another sound might be allocated that has the
* same pointer as an old, deleted parent, and since we use the pointer to the
* parent to determine which sounds share the same parent, it'll confuse GetCopies(). */
for( set<RageSound *>::iterator iter = all_sounds.begin(); iter != all_sounds.end(); ++iter )
if( (*iter)->GetOriginal() != (*iter) ) // child
{
set<RageSound *>::iterator parent = ToDelete.find( (*iter)->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 and all_sounds */