diff options
Diffstat (limited to 'ext/tk')
-rw-r--r-- | ext/tk/tkutil.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/tk/tkutil.c b/ext/tk/tkutil.c index aaa77b1aa8..0595207fe3 100644 --- a/ext/tk/tkutil.c +++ b/ext/tk/tkutil.c @@ -737,6 +737,13 @@ tk_conv_args(argc, argv, self) { int idx, size; volatile VALUE dst; + int thr_crit_bup; + VALUE old_gc; + + thr_crit_bup = rb_thread_critical; + rb_thread_critical = Qtrue; + + old_gc = rb_gc_disable(); if (argc < 2) { rb_raise(rb_eArgError, "too few arguments"); @@ -764,6 +771,9 @@ tk_conv_args(argc, argv, self) } } + if (old_gc == Qfalse) rb_gc_enable(); + rb_thread_critical = thr_crit_bup; + return rb_ary_plus(argv[0], dst); } |