mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-27 14:41:58 +00:00
Merged revisions 152134 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r152134 | tilghman | 2008-10-27 11:24:11 -0500 (Mon, 27 Oct 2008) | 4 lines Oops, only delete the ARG variables once upon release. The following section would have removed them again (removing variables from 2 stack frames, instead of just one). ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@152157 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -114,8 +114,6 @@ static int frame_set_var(struct ast_channel *chan, struct gosub_stack_frame *fra
|
|||||||
|
|
||||||
static void gosub_release_frame(struct ast_channel *chan, struct gosub_stack_frame *frame)
|
static void gosub_release_frame(struct ast_channel *chan, struct gosub_stack_frame *frame)
|
||||||
{
|
{
|
||||||
unsigned char i;
|
|
||||||
char argname[15];
|
|
||||||
struct ast_var_t *vardata;
|
struct ast_var_t *vardata;
|
||||||
|
|
||||||
/* If chan is not defined, then we're calling it as part of gosub_free,
|
/* If chan is not defined, then we're calling it as part of gosub_free,
|
||||||
@@ -124,14 +122,6 @@ static void gosub_release_frame(struct ast_channel *chan, struct gosub_stack_fra
|
|||||||
* that frame, so that we re-expose the variables from the previous frame
|
* that frame, so that we re-expose the variables from the previous frame
|
||||||
* that were hidden by this one.
|
* that were hidden by this one.
|
||||||
*/
|
*/
|
||||||
if (chan) {
|
|
||||||
for (i = 1; i <= frame->arguments && i != 0; i++) {
|
|
||||||
snprintf(argname, sizeof(argname), "ARG%hhd", i);
|
|
||||||
pbx_builtin_setvar_helper(chan, argname, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Delete local variables */
|
|
||||||
while ((vardata = AST_LIST_REMOVE_HEAD(&frame->varshead, entries))) {
|
while ((vardata = AST_LIST_REMOVE_HEAD(&frame->varshead, entries))) {
|
||||||
if (chan)
|
if (chan)
|
||||||
pbx_builtin_setvar_helper(chan, ast_var_name(vardata), NULL);
|
pbx_builtin_setvar_helper(chan, ast_var_name(vardata), NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user