*fixed a garbage collection issue with outer scope.

This commit is contained in:
Wang Renxin 2016-07-11 16:40:01 +08:00 committed by GitHub
parent 8730e3fb70
commit 697b6398f1

View File

@ -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);
}