Change ast_hangup() to return void and be NULL safe.

Since ast_hangup() is effectively a channel destructor, it should be a
void function.

* Make the few silly callers checking the return value no longer do so.
Only the CDR and CEL unit tests checked the return value.

* Make all callers take advantage of the NULL safe change and remove the
NULL check before the call.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2013-07-17 22:30:28 +00:00
parent da1902cdc0
commit 40ce5e0d18
12 changed files with 50 additions and 93 deletions

View File

@@ -2547,9 +2547,7 @@ static int builtin_atxfer(struct ast_channel *chan, struct ast_channel *peer, st
* is up, hang it up as it has no one to talk to.
*/
ast_debug(1, "Everyone is hungup.\n");
if (newchan) {
ast_hangup(newchan);
}
ast_hangup(newchan);
ast_party_connected_line_free(&connected_line);
return -1;
}
@@ -5586,18 +5584,14 @@ AST_TEST_DEFINE(features_test)
/* find the real channel */
parked_chan = ast_channel_get_by_name("TestChannel1");
if (unpark_test_channel(parked_chan, &args)) {
if (parked_chan) {
ast_hangup(parked_chan);
}
ast_hangup(parked_chan);
res = -1;
}
exit_features_test:
if (test_channel1) {
ast_hangup(test_channel1);
}
ast_hangup(test_channel1);
force_reload_load = 1;
ast_features_reload();