diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index e356d6fdef..a94d71cc42 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -4982,13 +4982,14 @@ static int unload_module(void) close(netsocket); io_context_destroy(io); - ast_sched_context_destroy(sched); mark_mappings(); prune_mappings(); mark_peers(); prune_peers(); + ast_sched_context_destroy(sched); + return 0; }