From: Jason Parker Date: Tue, 1 Feb 2011 17:00:55 +0000 (+0000) Subject: Close file descriptor for timing source when a MOH class gets destroyed. X-Git-Tag: 1.4.41-rc1~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d3d66c13b0c914acd46527e222107a7a5c546d9;p=thirdparty%2Fasterisk.git Close file descriptor for timing source when a MOH class gets destroyed. (closes issue #18457) Reported by: mcallist Patches: 18457-closetimer.diff uploaded by qwell (license 4) 18457-closetimer_trunk.diff uploaded by qwell (license 4) Tested by: qwell, loloski git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@305471 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index fae51b9a2f..8eedb1cd51 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -1143,6 +1143,11 @@ static void moh_class_destructor(void *obj) class->thread = AST_PTHREADT_NULL; } + if (class->pseudofd > -1) { + close(class->pseudofd); + class->pseudofd = -1; + } + if (class->filearray) { int i; for (i = 0; i < class->total_files; i++) {