Merged revisions 7582 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 21 Dec 2005 20:02:36 +0000 (20:02 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 21 Dec 2005 20:02:36 +0000 (20:02 +0000)
/branches/1.2

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7583 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_alsa.c

index 9bef8f3..6f0d360 100644 (file)
@@ -1109,8 +1109,10 @@ int unload_module()
        ast_channel_unregister(&alsa_tech);
        for (x=0;x<sizeof(myclis)/sizeof(struct ast_cli_entry); x++)
                ast_cli_unregister(myclis + x);
-       snd_pcm_close(alsa.icard);
-       snd_pcm_close(alsa.ocard);
+       if (alsa.icard)
+               snd_pcm_close(alsa.icard);
+       if (alsa.ocard)
+               snd_pcm_close(alsa.ocard);
        if (sndcmd[0] > 0) {
                close(sndcmd[0]);
                close(sndcmd[1]);