]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Added snd_pcm_munmap() call to snd_pcm_close() - free all resources
authorJaroslav Kysela <perex@perex.cz>
Sun, 22 Jun 2003 09:59:03 +0000 (09:59 +0000)
committerJaroslav Kysela <perex@perex.cz>
Sun, 22 Jun 2003 09:59:03 +0000 (09:59 +0000)
src/pcm/pcm.c
src/pcm/pcm_mmap.c

index 2eedd4c280337303ae46d4cffbd67eb9ca38b71b..1b260c5e16c9cf929f8701c68dec95b97afe17a2 100644 (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);
index 31ebec7085362800bd84d907ed113019d38af3fa..b02115a5498b13136df44f213bde28eb68936191 100644 (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;
 }