diff --git a/apps/app_followme.c b/apps/app_followme.c index 2303fcf684797bf4ec0cd7aae8a22e7f3498c5ae..9eb4ae2666ac3e1b622e7013cd416fb135b9d691 100644 --- a/apps/app_followme.c +++ b/apps/app_followme.c @@ -1081,16 +1081,19 @@ static int app_exec(struct ast_channel *chan, void *data) static int unload_module(void *mod) { + STANDARD_HANGUP_LOCALUSERS; + ast_unregister_application(app); struct ast_call_followme *f; /* Free Memory. Yeah! I'm free! */ + AST_LIST_LOCK(&followmes); AST_LIST_TRAVERSE_SAFE_BEGIN(&followmes, f, entry) { free_numbers(f); AST_LIST_REMOVE_CURRENT(&followmes, entry); free(f); } AST_LIST_TRAVERSE_SAFE_END - STANDARD_HANGUP_LOCALUSERS; - return ast_unregister_application(app); + AST_LIST_UNLOCK(&followmes); + return 0; } static int load_module(void *mod)