From 9b18348293c87171ee004fae99e2a18eecbacfb5 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 31 Oct 2015 01:25:32 +0000 Subject: [PATCH] tcltklib.c: GC guard * ext/tk/tcltklib.c (setup_rubytkkit): add GC guard instead of volatile. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/tcltklib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c index b0d0d6162d..01479301d8 100644 --- a/ext/tk/tcltklib.c +++ b/ext/tk/tcltklib.c @@ -1263,10 +1263,11 @@ setup_rubytkkit(void) #ifdef __WIN32__ /* rbtk_win32_SetHINSTANCE("tcltklib.so"); */ { - volatile VALUE basename; + VALUE basename; basename = rb_funcall(rb_cFile, rb_intern("basename"), 1, rb_str_new2(rb_sourcefile())); rbtk_win32_SetHINSTANCE(RSTRING_PTR(basename)); + RB_GC_GUARD(basename); } #endif set_rubytk_kitpath(rb_sourcefile());