aboutsummaryrefslogtreecommitdiffstats
path: root/main/translate.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-10 23:08:36 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-10 23:08:36 +0000
commitd3e901b751ec434ae884e5532808f20a5fe62f01 (patch)
tree234961e29f40f439010b607b5784cb7880df2244 /main/translate.c
parent243b2a3a5ffd4c50ba3fa9d3d6c91baea73e4124 (diff)
1) When we get a translated frame out, clone it, because if the
translator pvt is freed before we use the frame, bad things happen. 2) Getting a failure from ast_sched_delete means that the schedule ID is currently running. Don't just ignore it. (Closes issue #11698) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@97973 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/translate.c')
-rw-r--r--main/translate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main/translate.c b/main/translate.c
index e01ce9321..cc898a5db 100644
--- a/main/translate.c
+++ b/main/translate.c
@@ -232,7 +232,10 @@ struct ast_frame *ast_trans_frameout(struct ast_trans_pvt *pvt,
f->offset = AST_FRIENDLY_OFFSET;
f->src = pvt->t->name;
f->data = pvt->outbuf;
- return f;
+ /* We must clone the frame, because the pvt could disappear
+ * the moment after we return (and unlock the source channel).
+ */
+ return ast_frisolate(f);
}
static struct ast_frame *default_frameout(struct ast_trans_pvt *pvt)