]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
pbx: Fix lack of cleanup on macrolock and context_table
authorJonathan Rose <jrose@digium.com>
Mon, 13 May 2013 18:16:21 +0000 (18:16 +0000)
committerJonathan Rose <jrose@digium.com>
Mon, 13 May 2013 18:16:21 +0000 (18:16 +0000)
(closes issue ASTERISK-21723)
Reported by: Corey Farrell
Patches:
    core-pbx-cleanup.patch uploaded by Correy Farrell (license 5909)

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

main/pbx.c

index fbe06fc7644f62f62b91aee8570cf24fad1279b6..7495367622e23d26b230f96269b918a707b7e9ce 100644 (file)
@@ -9383,6 +9383,7 @@ static void __ast_internal_context_destroy( struct ast_context *con)
        }
        tmp->root = NULL;
        ast_rwlock_destroy(&tmp->lock);
+       ast_mutex_destroy(&tmp->macrolock);
        ast_free(tmp);
 }
 
@@ -10978,6 +10979,10 @@ static void pbx_shutdown(void)
                ao2_ref(statecbs, -1);
                statecbs = NULL;
        }
+       if (contexts_table) {
+               ast_hashtab_destroy(contexts_table, NULL);
+       }
+       pbx_builtin_clear_globals();
 }
 
 int ast_pbx_init(void)