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:
parent
8b6c511200
commit
f806dea3dd
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue