From: Joshua Colp Date: Sat, 13 Jan 2007 03:04:55 +0000 (+0000) Subject: Only join the snmp thread on an unload if the thread is actually running. (issue... X-Git-Tag: 1.4.1~290 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cc242206c6bb6df828ba56ee1207f0efb35dfa54;p=thirdparty%2Fasterisk.git Only join the snmp thread on an unload if the thread is actually running. (issue #8810 reported by junky) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50674 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_snmp.c b/res/res_snmp.c index 2ccadc4073..cbca08a419 100644 --- a/res/res_snmp.c +++ b/res/res_snmp.c @@ -106,7 +106,7 @@ static int unload_module(void) ast_verbose(VERBOSE_PREFIX_1 "Unloading [Sub]Agent Module\n"); res_snmp_dont_stop = 0; - return pthread_join(thread, NULL); + return ((thread != AST_PTHREADT_NULL) ? pthread_join(thread, NULL) : 0); } static int reload(void)