|
|
@ -897,14 +897,16 @@ void ast_channel_free(struct ast_channel *chan)
|
|
|
|
last = cur;
|
|
|
|
last = cur;
|
|
|
|
cur = cur->next;
|
|
|
|
cur = cur->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!cur)
|
|
|
|
if (!cur) {
|
|
|
|
ast_log(LOG_WARNING, "Unable to find channel in list\n");
|
|
|
|
ast_mutex_unlock(&chlock);
|
|
|
|
else {
|
|
|
|
ast_log(LOG_ERROR, "Unable to find channel in list to free. Assuming it has already been done.\n");
|
|
|
|
/* Lock and unlock the channel just to be sure nobody
|
|
|
|
return;
|
|
|
|
has it locked still */
|
|
|
|
|
|
|
|
ast_mutex_lock(&cur->lock);
|
|
|
|
|
|
|
|
ast_mutex_unlock(&cur->lock);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Lock and unlock the channel just to be sure nobody
|
|
|
|
|
|
|
|
has it locked still */
|
|
|
|
|
|
|
|
ast_mutex_lock(&cur->lock);
|
|
|
|
|
|
|
|
ast_mutex_unlock(&cur->lock);
|
|
|
|
if (chan->tech_pvt) {
|
|
|
|
if (chan->tech_pvt) {
|
|
|
|
ast_log(LOG_WARNING, "Channel '%s' may not have been hung up properly\n", chan->name);
|
|
|
|
ast_log(LOG_WARNING, "Channel '%s' may not have been hung up properly\n", chan->name);
|
|
|
|
free(chan->tech_pvt);
|
|
|
|
free(chan->tech_pvt);
|
|
|
|