This might happen if the wng is destroyed before any output was
produced. This bug could trigger
para_audiod: pcm.c:1105: snd_pcm_drain: Assertion `pcm' failed
causing audiod to crash.
{
struct private_alsa_write_data *pad = wn->private_data;
PARA_INFO_LOG("closing writer node %p\n", wn);
- snd_pcm_drain(pad->handle);
- snd_pcm_close(pad->handle);
- snd_config_update_free_global();
+
+ if (pad->handle) {
+ snd_pcm_drain(pad->handle);
+ snd_pcm_close(pad->handle);
+ snd_config_update_free_global();
+ }
free(pad);
}