From f806dea3dd2dc2221881c9aba9d66d292d246f9e Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Thu, 8 Nov 2007 20:39:41 +0000 Subject: convert this code to a more efficient idiom git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89118 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_features.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'channels') diff --git a/channels/chan_features.c b/channels/chan_features.c index f352afaeb..98e14c0af 100644 --- a/channels/chan_features.c +++ b/channels/chan_features.c @@ -568,13 +568,11 @@ static int unload_module(void) if (!AST_LIST_LOCK(&features)) return -1; /* Hangup all interfaces if they have an owner */ - AST_LIST_TRAVERSE_SAFE_BEGIN(&features, p, list) { + while ((p = AST_LIST_REMOVE_HEAD(&features, list))) { if (p->owner) ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD); - AST_LIST_REMOVE_CURRENT(list); ast_free(p); } - AST_LIST_TRAVERSE_SAFE_END AST_LIST_UNLOCK(&features); return 0; -- cgit v1.2.3