Use RageSound::DeleteSelfWhenFinishedPlaying().

This commit is contained in:
Glenn Maynard
2007-01-18 08:18:00 +00:00
parent a2d63e2767
commit 7e8e8aed36
+2 -6
View File
@@ -189,12 +189,12 @@ RageSound *RageSoundManager::PlaySound( RageSound &snd, const RageSoundParams *p
RageSound *RageSoundManager::PlayCopyOfSound( RageSound &snd, const RageSoundParams *pParams ) RageSound *RageSoundManager::PlayCopyOfSound( RageSound &snd, const RageSoundParams *pParams )
{ {
RageSound *pSound = new RageSound( snd ); RageSound *pSound = new RageSound( snd );
DeleteSoundWhenFinished( pSound );
if( pParams ) if( pParams )
pSound->SetParams( *pParams ); pSound->SetParams( *pParams );
pSound->StartPlaying(); pSound->StartPlaying();
pSound->DeleteSelfWhenFinishedPlaying();
return pSound; return pSound;
} }
@@ -250,11 +250,7 @@ void RageSoundManager::PlayOnce( RString sPath )
pSound->Load( sPath, false ); pSound->Load( sPath, false );
pSound->Play(); pSound->Play();
pSound->DeleteSelfWhenFinishedPlaying();
/* We're responsible for freeing it. Add it to owned_sounds *after* we start
* playing, so RageSoundManager::Update doesn't free it before we actually start
* it. */
DeleteSoundWhenFinished( pSound );
} }
void RageSoundManager::SetMixVolume( float fMixVol ) void RageSoundManager::SetMixVolume( float fMixVol )