summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-06-01 06:59:20 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-06-01 06:59:20 +0000
commit2996504623d83ecb5620e7660e871a98aa9771e4 (patch)
tree1223800adb282895acdbc71d182e9f1d37ec9d6b /eval.c
parent8a4cbc733114d0a51bc324b466764d10985cbd80 (diff)
rb_exec_end_proc, etc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/eval.c b/eval.c
index d8416e3948..79c181e7d2 100644
--- a/eval.c
+++ b/eval.c
@@ -973,8 +973,6 @@ static void rb_thread_wait_other_threads _((void));
static int exit_status;
-static void exec_end_proc _((void));
-
void
ruby_run()
{
@@ -1057,7 +1055,7 @@ ruby_run()
rb_bug("Unknown longjmp status %d", ex);
break;
}
- exec_end_proc();
+ rb_exec_end_proc();
rb_gc_call_finalizer_at_exit();
exit(ex);
}
@@ -2954,7 +2952,8 @@ rb_exit(status)
exit_status = status;
rb_exc_raise(rb_exc_new(rb_eSystemExit, 0, 0));
}
- exec_end_proc();
+ rb_exec_end_proc();
+ rb_gc_call_finalizer_at_exit();
exit(status);
}
@@ -5114,16 +5113,20 @@ rb_f_at_exit()
return proc;
}
-static void
-exec_end_proc()
+void
+rb_exec_end_proc()
{
struct end_proc_data *link = end_proc_data;
+ struct end_proc_data *tmp;
int status;
while (link) {
rb_protect((VALUE(*)())link->func, link->data, &status);
- link = link->next;
+ tmp = link->next;
+ free(link);
+ link = tmp;
}
+ end_proc_data = 0;
}
void