Added snd_pcm_munmap() call to snd_pcm_close() - free all resources

This commit is contained in:
Jaroslav Kysela 2003-06-22 09:59:03 +00:00
parent 501342abbb
commit b004a9d791
2 changed files with 4 additions and 2 deletions

View file

@ -665,6 +665,8 @@ int snd_pcm_close(snd_pcm_t *pcm)
if (err < 0)
return err;
}
if (pcm->mmap_channels)
snd_pcm_munmap(pcm);
while (!list_empty(&pcm->async_handlers)) {
snd_async_handler_t *h = list_entry(pcm->async_handlers.next, snd_async_handler_t, hlist);
snd_async_del_handler(h);

View file

@ -476,8 +476,8 @@ int snd_pcm_munmap(snd_pcm_t *pcm)
return err;
free(pcm->mmap_channels);
free(pcm->running_areas);
pcm->mmap_channels = 0;
pcm->running_areas = 0;
pcm->mmap_channels = NULL;
pcm->running_areas = NULL;
return 0;
}