]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
This was accidentally reverted.
authorJeff Peeler <jpeeler@digium.com>
Sun, 8 Jun 2008 01:41:59 +0000 (01:41 +0000)
committerJeff Peeler <jpeeler@digium.com>
Sun, 8 Jun 2008 01:41:59 +0000 (01:41 +0000)
Fixes a bug where if a stream monitor thread was not created (caused from failure of opening or starting the stream) pthread_cancel was called with an invalid thread ID.

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

channels/chan_console.c

index 4ad5e793c8101e838b2ee87f926597def96556f6..10f77fdc798d54cc496ffd4d97ba1b9c2808e5c4 100644 (file)
@@ -393,7 +393,7 @@ return_unlock:
 
 static int stop_stream(struct console_pvt *pvt)
 {
-       if (!pvt->streamstate)
+       if (!pvt->streamstate || pvt->thread == AST_PTHREADT_NULL)
                return 0;
 
        pthread_cancel(pvt->thread);