Permalink
Browse files

call at_exit blocks within exception handlers

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@3293 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
lrz committed Jan 18, 2010
1 parent 91f4d14 commit d649cff3399e999418403ad4fb0fc7d6dea71d03
Showing with 14 additions and 1 deletion.
  1. +14 −1 eval_jump.c
View
@@ -40,6 +40,19 @@ rb_f_at_exit(VALUE self, SEL sel)
return proc;
}
+static VALUE
+rb_end_proc_call_try(VALUE proc)
+{
+ return rb_proc_call2(proc, 0, NULL);
+}
+
+static VALUE
+rb_end_proc_call_catch(VALUE data)
+{
+ rb_vm_print_current_exception();
+ return Qnil;
+}
+
void
rb_exec_end_proc(void)
{
@@ -48,7 +61,7 @@ rb_exec_end_proc(void)
if (count > 0) {
VALUE proc = RARRAY_AT(at_exit_procs, count - 1);
rb_ary_delete_at(at_exit_procs, count - 1);
- rb_proc_call2(proc, 0, NULL);
+ rb_rescue(rb_end_proc_call_try, proc, rb_end_proc_call_catch, 0);
continue;
}
break;

0 comments on commit d649cff

Please sign in to comment.