*fixed a multiple disposing bug.

This commit is contained in:
Wang Renxin 2017-10-14 16:44:40 +08:00
parent e9ffc75852
commit ae3597a8ba
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,6 @@
Oct. 14 2017
Fixed a multiple disposing bug with the PRINT statement
Oct. 9 2017 Oct. 9 2017
Improved expression evaluation speed Improved expression evaluation speed

View File

@ -17424,6 +17424,14 @@ static int _std_print(mb_interpreter_t* s, void** l) {
case _DT_FUNC: /* Fall through */ case _DT_FUNC: /* Fall through */
case _DT_ROUTINE: case _DT_ROUTINE:
result = _calc_expression(s, &ast, &val_ptr); 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) _REF(val_ptr)
_UNREF(val_ptr) _UNREF(val_ptr)
_print: _print: