summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-02 14:58:41 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-02 14:58:41 +0000
commit7911d42f1b3b4d6fdaab7a70d69c7bb1351af06c (patch)
tree66659477a17309a0af903d8176d63ae066fe5831 /eval.c
parent2f1a781e8506cb878cba878070e8bcaa7e6e5d5d (diff)
* NEWS: entry for ruby_vm_at_exit().
* eval.c (ruby_cleanup): bug fix around at_exit (1) timing was wrong. (2) execution order was opposite. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/eval.c b/eval.c
index e54b5400c8..acfe8e93d5 100644
--- a/eval.c
+++ b/eval.c
@@ -151,13 +151,6 @@ ruby_cleanup(volatile int ex)
}
POP_TAG();
- /* at_exit functions called here; any other place more apropriate
- * for this purpose? let me know if any. */
- for (i=0; i<RARRAY_LEN(ary); i++) {
- ((void(*)(rb_vm_t*))RARRAY_PTR(ary)[i])(vm);
- }
- rb_ary_clear(ary);
-
errs[0] = th->errinfo;
PUSH_TAG();
if ((state = EXEC_TAG()) == 0) {
@@ -172,6 +165,13 @@ ruby_cleanup(volatile int ex)
POP_TAG();
rb_thread_stop_timer_thread();
+ /* at_exit functions called here; any other place more apropriate
+ * for this purpose? let me know if any. */
+ for (i=RARRAY_LEN(ary) - 1; i>=0; i--) {
+ ((void(*)(rb_vm_t*))RARRAY_PTR(ary)[i])(vm);
+ }
+ rb_ary_clear(ary);
+
#if EXIT_SUCCESS != 0 || EXIT_FAILURE != 1
switch (ex) {
#if EXIT_SUCCESS != 0