convert this code to a more efficient idiom

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming 2007-11-08 20:39:41 +00:00
parent 8b6c511200
commit f806dea3dd
1 changed files with 1 additions and 3 deletions

View File

@ -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;