*fixed a memory leak with sub routine.

This commit is contained in:
Wang Renxin 2017-04-05 17:41:49 +08:00
parent cf3870509a
commit 87e8ef6a4b
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Apr. 5 2017
Fixed a wrong hash bug with pointer, which may cause crash on some 64bit systems
Fixed a memory leak with sub routine
Mar. 29 2017
Added an alive object checker of referenced usertype

View File

@ -9404,7 +9404,7 @@ static int _do_nothing_on_object(void* data, void* extra) {
return result;
}
/* Lose an object of of scope */
/* Lose an object in a scope */
static int _lose_object(void* data, void* extra) {
int result = _OP_RESULT_NORMAL;
_object_t* obj = 0;
@ -9413,6 +9413,10 @@ static int _lose_object(void* data, void* extra) {
mb_assert(data && extra);
obj = (_object_t*)data;
#ifdef MB_ENABLE_LAMBDA
if(obj->type == _DT_ROUTINE && obj->data.routine->type == _IT_LAMBDA)
obj->is_ref = false;
#endif /* MB_ENABLE_LAMBDA */
switch(obj->type) {
case _DT_VAR:
_lose_object(obj->data.variable->data, extra);