mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #6232 from dearblue/free-env
Fold the code for freeing `env`
This commit is contained in:
@@ -761,13 +761,9 @@ obj_free(mrb_state *mrb, struct RBasic *obj, mrb_bool end)
|
||||
{
|
||||
struct REnv *e = (struct REnv*)obj;
|
||||
|
||||
if (MRB_ENV_ONSTACK_P(e)) {
|
||||
/* cannot be freed */
|
||||
e->stack = NULL;
|
||||
break;
|
||||
if (!MRB_ENV_ONSTACK_P(e)) {
|
||||
mrb_free(mrb, e->stack);
|
||||
}
|
||||
mrb_free(mrb, e->stack);
|
||||
e->stack = NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user