From 697b6398f12b44ed8b119aafe9c40d5cea66838f Mon Sep 17 00:00:00 2001 From: Wang Renxin Date: Mon, 11 Jul 2016 16:40:01 +0800 Subject: [PATCH] *fixed a garbage collection issue with outer scope. --- core/my_basic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/my_basic.c b/core/my_basic.c index 0db6175..3001619 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -6086,7 +6086,7 @@ static int _gc_destroy_garbage(void* data, void* extra, _gc_t* gc) { if(routine->type == _IT_LAMBDA) { _HT_FOREACH(routine->func.lambda.scope->var_dict, _do_nothing_on_object, _gc_destroy_garbage_in_lambda, gc); _ht_clear(routine->func.lambda.scope->var_dict); - if(!routine->func.lambda.outer_scope || !_ht_find(gc->collected_table, &routine->func.lambda.outer_scope->ref)) + if(routine->func.lambda.outer_scope && !_ht_find(gc->collected_table, &routine->func.lambda.outer_scope->ref)) _gc_destroy_garbage_in_outer_scope(routine->func.lambda.outer_scope, gc); }