Commit 4c1fb65d authored by take_cheeze's avatar take_cheeze

Release `mrb->atexit_stack` on `mrb_close`.

parent b1dd57ef
...@@ -221,11 +221,13 @@ mrb_free_context(mrb_state *mrb, struct mrb_context *c) ...@@ -221,11 +221,13 @@ mrb_free_context(mrb_state *mrb, struct mrb_context *c)
void void
mrb_close(mrb_state *mrb) mrb_close(mrb_state *mrb)
{ {
if (mrb->atexit_stack_len > 0) {
mrb_int i; mrb_int i;
for (i = mrb->atexit_stack_len; i > 0; --i) { for (i = mrb->atexit_stack_len; i > 0; --i) {
mrb->atexit_stack[i - 1](mrb); mrb->atexit_stack[i - 1](mrb);
} }
mrb_free(mrb, mrb->atexit_stack);
}
/* free */ /* free */
mrb_gc_free_gv(mrb); mrb_gc_free_gv(mrb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment