From: Jaroslav Kysela Date: Sun, 22 Jun 2003 09:59:03 +0000 (+0000) Subject: Added snd_pcm_munmap() call to snd_pcm_close() - free all resources X-Git-Tag: v1.0.3~161 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=b004a9d791d1f2bfe01172942cc86866d1eee7cb;p=alsa-lib.git Added snd_pcm_munmap() call to snd_pcm_close() - free all resources --- diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c index 2eedd4c2..1b260c5e 100644 --- a/src/pcm/pcm.c +++ b/src/pcm/pcm.c @@ -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); diff --git a/src/pcm/pcm_mmap.c b/src/pcm/pcm_mmap.c index 31ebec70..b02115a5 100644 --- a/src/pcm/pcm_mmap.c +++ b/src/pcm/pcm_mmap.c @@ -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; }