mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #2951 from tatsuhiro-t/mrb_close_with_nullptr
Don't crash if NULL is passed to mrb_close
This commit is contained in:
@@ -234,6 +234,7 @@ mrb_free_context(mrb_state *mrb, struct mrb_context *c)
|
||||
MRB_API void
|
||||
mrb_close(mrb_state *mrb)
|
||||
{
|
||||
if (!mrb) return;
|
||||
if (mrb->atexit_stack_len > 0) {
|
||||
mrb_int i;
|
||||
for (i = mrb->atexit_stack_len; i > 0; --i) {
|
||||
|
||||
Reference in New Issue
Block a user