diff --git a/eval.c b/eval.c index 3a21525..ced0415 100644 --- a/eval.c +++ b/eval.c @@ -136,6 +136,7 @@ ruby_cleanup(volatile int ex) errs[0] = th->errinfo; PUSH_TAG(); + ruby_finalize_1(); if ((state = EXEC_TAG()) == 0) { SAVE_ROOT_JMPBUF(th, rb_thread_terminate_all()); } @@ -144,7 +145,6 @@ ruby_cleanup(volatile int ex) } th->errinfo = errs[1]; ex = error_handle(ex); - ruby_finalize_1(); POP_TAG(); rb_thread_stop_timer_thread(1);