ensure channel's scheduling context is freed (issue #5788)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@7268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Kevin P. Fleming 20 years ago
parent 9bbfbacacc
commit 0d3fc8d103

@ -909,6 +909,9 @@ void ast_channel_free(struct ast_channel *chan)
free(chan->tech_pvt);
}
if (chan->sched)
sched_context_destroy(chan->sched);
ast_copy_string(name, chan->name, sizeof(name));
/* Stop monitoring */
@ -1294,8 +1297,10 @@ int ast_hangup(struct ast_channel *chan)
ast_closestream(chan->stream);
if (chan->vstream) /* Close video stream */
ast_closestream(chan->vstream);
if (chan->sched)
if (chan->sched) {
sched_context_destroy(chan->sched);
chan->sched = NULL;
}
if (chan->generatordata) /* Clear any tone stuff remaining */
chan->generator->release(chan, chan->generatordata);

Loading…
Cancel
Save