From ae3597a8bae1dcb67694d36cbbea24d3ee1ced73 Mon Sep 17 00:00:00 2001 From: Wang Renxin Date: Sat, 14 Oct 2017 16:44:40 +0800 Subject: [PATCH] *fixed a multiple disposing bug. --- HISTORY | 3 +++ core/my_basic.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/HISTORY b/HISTORY index 428a33d..e69a0b2 100755 --- a/HISTORY +++ b/HISTORY @@ -1,3 +1,6 @@ +Oct. 14 2017 +Fixed a multiple disposing bug with the PRINT statement + Oct. 9 2017 Improved expression evaluation speed diff --git a/core/my_basic.c b/core/my_basic.c index d5a775a..f365c1f 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -17424,6 +17424,14 @@ static int _std_print(mb_interpreter_t* s, void** l) { case _DT_FUNC: /* Fall through */ case _DT_ROUTINE: result = _calc_expression(s, &ast, &val_ptr); + if(val_ptr->type == _DT_ROUTINE) { +#ifdef MB_ENABLE_LAMBDA + if(val_ptr->data.routine->type != MB_RT_LAMBDA) + val_ptr->is_ref = true; +#else /* MB_ENABLE_LAMBDA */ + val_ptr->is_ref = true; +#endif /* MB_ENABLE_LAMBDA */ + } _REF(val_ptr) _UNREF(val_ptr) _print: