Allow a chan_alsa that failed to open sound devices to be unloaded.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@7582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2005-12-21 20:01:16 +00:00
parent 2783801610
commit 37a49a5992

View 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]);