From 7d0888f97d115ea38d06f6bdcabb1674c29292de Mon Sep 17 00:00:00 2001 From: Kevin Larke Date: Mon, 11 Aug 2014 11:43:52 -0700 Subject: [PATCH] cmMidiAlsa.c : cmMpFinalize() now checks for a NULL handle before call snd_seq_stop_queue(). --- linux/cmMidiAlsa.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/linux/cmMidiAlsa.c b/linux/cmMidiAlsa.c index 6994282..0dd5d1c 100644 --- a/linux/cmMidiAlsa.c +++ b/linux/cmMidiAlsa.c @@ -561,11 +561,12 @@ cmMpRC_t cmMpFinalize() } // stop the queue - if((arc = snd_seq_stop_queue(p->h,p->alsa_queue, NULL)) < 0 ) - { - rc = _cmMpErrMsg(&p->err,kSysErrMpRC,arc,"ALSA queue stop failed."); - goto errLabel; - } + if( p->h != NULL ) + if((arc = snd_seq_stop_queue(p->h,p->alsa_queue, NULL)) < 0 ) + { + rc = _cmMpErrMsg(&p->err,kSysErrMpRC,arc,"ALSA queue stop failed."); + goto errLabel; + } // release the alsa queue if( p->alsa_queue != -1 )