We didn't acquire/release a BSound reference when playing using a BSoundPlayer

which lead to #4825.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33705 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2009-10-21 15:20:37 +00:00
parent 1c7348a787
commit 6fb91db708

View File

@ -609,6 +609,7 @@ BSoundPlayer::StartPlaying(BSound *sound, bigtime_t atTime, float withVolume)
return B_ERROR;
}
sound->AcquireRef();
item->next = fPlayingSounds;
fPlayingSounds = item;
fLocker.Unlock();
@ -676,6 +677,7 @@ BSoundPlayer::StopPlaying(play_id id)
if (item->id == id) {
*link = item->next;
sem_id waitSem = item->wait_sem;
item->sound->ReleaseRef();
free(item);
fLocker.Unlock();