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:
@@ -609,6 +609,7 @@ BSoundPlayer::StartPlaying(BSound *sound, bigtime_t atTime, float withVolume)
|
|||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sound->AcquireRef();
|
||||||
item->next = fPlayingSounds;
|
item->next = fPlayingSounds;
|
||||||
fPlayingSounds = item;
|
fPlayingSounds = item;
|
||||||
fLocker.Unlock();
|
fLocker.Unlock();
|
||||||
@@ -676,6 +677,7 @@ BSoundPlayer::StopPlaying(play_id id)
|
|||||||
if (item->id == id) {
|
if (item->id == id) {
|
||||||
*link = item->next;
|
*link = item->next;
|
||||||
sem_id waitSem = item->wait_sem;
|
sem_id waitSem = item->wait_sem;
|
||||||
|
item->sound->ReleaseRef();
|
||||||
free(item);
|
free(item);
|
||||||
fLocker.Unlock();
|
fLocker.Unlock();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user