Index: main/pbx.c =================================================================== --- main/pbx.c (revision 386686) +++ main/pbx.c (working copy) @@ -9383,6 +9383,7 @@ } tmp->root = NULL; ast_rwlock_destroy(&tmp->lock); + ast_mutex_destroy(&tmp->macrolock); ast_free(tmp); } @@ -10978,6 +10979,10 @@ ao2_ref(statecbs, -1); statecbs = NULL; } + if (contexts_table) { + ast_hashtab_destroy(contexts_table, NULL); + } + pbx_builtin_clear_globals(); } int ast_pbx_init(void)