mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-20 03:26:55 +00:00
Remove tasks from the taskprocessor and free them when taskprocessor is destroyed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -417,6 +417,7 @@ static int tps_cmp_cb(void *obj, void *arg, int flags)
|
|||||||
static void tps_taskprocessor_destroy(void *tps)
|
static void tps_taskprocessor_destroy(void *tps)
|
||||||
{
|
{
|
||||||
struct ast_taskprocessor *t = tps;
|
struct ast_taskprocessor *t = tps;
|
||||||
|
struct tps_task *task;
|
||||||
|
|
||||||
if (!tps) {
|
if (!tps) {
|
||||||
ast_log(LOG_ERROR, "missing taskprocessor\n");
|
ast_log(LOG_ERROR, "missing taskprocessor\n");
|
||||||
@@ -437,6 +438,9 @@ static void tps_taskprocessor_destroy(void *tps)
|
|||||||
ao2_ref(t->listener, -1);
|
ao2_ref(t->listener, -1);
|
||||||
t->listener = NULL;
|
t->listener = NULL;
|
||||||
}
|
}
|
||||||
|
while ((task = AST_LIST_REMOVE_HEAD(&t->tps_queue, list))) {
|
||||||
|
tps_task_free(task);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pop the front task and return it */
|
/* pop the front task and return it */
|
||||||
|
Reference in New Issue
Block a user