summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-05-25 08:26:20 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-05-25 08:26:20 +0000
commit1307f8d555235116f0f0c79b9902df9cfd4bff12 (patch)
treefaf8962d1f1fcdb54db653b4a99b148fdecea7e6 /gc.c
parent1aba398e29bd9134f83c165a2495883f72cbbb3d (diff)
regexp null pattern
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index b7c8475..87be51c 100644
--- a/gc.c
+++ b/gc.c
@@ -1072,15 +1072,26 @@ call_final(os, obj)
return obj;
}
+static VALUE
+run_single_final(args)
+ VALUE *args;
+{
+ rb_eval_cmd(args[0], args[1]);
+ return Qnil;
+}
+
static void
run_final(obj)
VALUE obj;
{
- int i;
+ int i, status;
+ VALUE args[2];
obj = rb_obj_id(obj); /* make obj into id */
+ args[1] = rb_ary_new3(1, obj);
for (i=0; i<RARRAY(finalizers)->len; i++) {
- rb_eval_cmd(RARRAY(finalizers)->ptr[i], rb_ary_new3(1, obj));
+ args[0] = RARRAY(finalizers)->ptr[i];
+ rb_protect(run_single_final, (VALUE)args, &status);
}
}