summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/-test-/tracepoint/tracepoint.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/-test-/tracepoint/tracepoint.c b/ext/-test-/tracepoint/tracepoint.c
index 245dbd6191..aa8c212f99 100644
--- a/ext/-test-/tracepoint/tracepoint.c
+++ b/ext/-test-/tracepoint/tracepoint.c
@@ -64,8 +64,7 @@ tracepoint_track_objspace_events(VALUE self)
VALUE result = rb_ary_new();
rb_tracepoint_enable(tpval);
- rb_yield(Qundef);
- rb_tracepoint_disable(tpval);
+ rb_ensure(rb_yield, Qundef, rb_tracepoint_disable, tpval);
rb_ary_push(result, SIZET2NUM(track.newobj_count));
rb_ary_push(result, SIZET2NUM(track.free_count));