diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index d80f660299..b6f7a1ad09 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -4981,13 +4981,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; }