mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Reorder finalization to avoid potential crash; ref #4618
`mrb_gc_destroy` may call other mruby API functions from the finalizers. So call that function first.
This commit is contained in:
+3
-3
@@ -221,10 +221,10 @@ mrb_close(mrb_state *mrb)
|
||||
}
|
||||
|
||||
/* free */
|
||||
mrb_gc_free_gv(mrb);
|
||||
mrb_free_context(mrb, mrb->root_c);
|
||||
mrb_free_symtbl(mrb);
|
||||
mrb_gc_destroy(mrb, &mrb->gc);
|
||||
mrb_free_context(mrb, mrb->root_c);
|
||||
mrb_gc_free_gv(mrb);
|
||||
mrb_free_symtbl(mrb);
|
||||
mrb_free(mrb, mrb);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user