diff options
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1654,14 +1654,15 @@ ruby_vm_destruct(rb_vm_t *vm) st_free_table(vm->living_threads); vm->living_threads = 0; } + ruby_vm_run_at_exit_hooks(vm); + rb_vm_gvl_destroy(vm); #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE if (objspace) { rb_objspace_free(objspace); } #endif - ruby_vm_run_at_exit_hooks(vm); - rb_vm_gvl_destroy(vm); - ruby_xfree(vm); + /* after freeing objspace, you *can't* use ruby_xfree() */ + ruby_mimfree(vm); ruby_current_vm = 0; } RUBY_FREE_LEAVE("vm"); |