Use RageSound::DeleteSelfWhenFinishedPlaying().
This commit is contained in:
@@ -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 )
|
||||||
|
|||||||
Reference in New Issue
Block a user