mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Adam Tla/lka <atlka@pg.gda.pl>
SHM memory leak fix
This commit is contained in:
parent
6c3f250896
commit
852b0c6129
1 changed files with 10 additions and 5 deletions
|
|
@ -462,11 +462,16 @@ int snd_pcm_munmap(snd_pcm_t *pcm)
|
||||||
if (i->u.shm.area) {
|
if (i->u.shm.area) {
|
||||||
snd_shm_area_destroy(i->u.shm.area);
|
snd_shm_area_destroy(i->u.shm.area);
|
||||||
i->u.shm.area = NULL;
|
i->u.shm.area = NULL;
|
||||||
} else {
|
if (pcm->access == SND_PCM_ACCESS_MMAP_INTERLEAVED ||
|
||||||
err = shmdt(i->addr);
|
pcm->access == SND_PCM_ACCESS_RW_INTERLEAVED) {
|
||||||
if (err < 0) {
|
unsigned int c1;
|
||||||
SYSERR("shmdt failed");
|
for (c1 = c + 1; c1 < pcm->channels; c1++) {
|
||||||
return -errno;
|
snd_pcm_channel_info_t *i1 = &pcm->mmap_channels[c1];
|
||||||
|
if (i1->u.shm.area) {
|
||||||
|
snd_shm_area_destroy(i1->u.shm.area);
|
||||||
|
i1->u.shm.area = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue