- fixed null pointer: channel cleanup must be done at end of hangup

This commit is contained in:
MelwareDE 2006-06-27 08:20:19 +00:00
parent 2f3a449f5b
commit 25dceb2571
1 changed files with 3 additions and 3 deletions

View File

@ -1107,9 +1107,6 @@ static int pbx_capi_hangup(struct ast_channel *c)
ast_update_use_count();
CC_CHANNEL_PVT(c) = NULL;
ast_setstate(c, AST_STATE_DOWN);
if ((i->doDTMF > 0) && (i->vad != NULL)) {
ast_dsp_free(i->vad);
i->vad = NULL;
@ -1126,6 +1123,9 @@ static int pbx_capi_hangup(struct ast_channel *c)
capi_activehangup(c, state);
}
CC_CHANNEL_PVT(c) = NULL;
ast_setstate(c, AST_STATE_DOWN);
cc_mutex_lock(&usecnt_lock);
usecnt--;
cc_mutex_unlock(&usecnt_lock);