]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Close file descriptor for timing source when a MOH class gets destroyed.
authorJason Parker <jparker@digium.com>
Tue, 1 Feb 2011 17:00:55 +0000 (17:00 +0000)
committerJason Parker <jparker@digium.com>
Tue, 1 Feb 2011 17:00:55 +0000 (17:00 +0000)
(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

res/res_musiconhold.c

index fae51b9a2f5bdbf82f3ae1bd13367ebd0670ac8f..8eedb1cd51d7beea979a8beef8e63f787c304902 100644 (file)
@@ -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++) {