1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2015-10-31 01:25:32 +00:00
parent ce7f8287e2
commit 9b18348293

View file

@ -1263,10 +1263,11 @@ setup_rubytkkit(void)
#ifdef __WIN32__ #ifdef __WIN32__
/* rbtk_win32_SetHINSTANCE("tcltklib.so"); */ /* rbtk_win32_SetHINSTANCE("tcltklib.so"); */
{ {
volatile VALUE basename; VALUE basename;
basename = rb_funcall(rb_cFile, rb_intern("basename"), 1, basename = rb_funcall(rb_cFile, rb_intern("basename"), 1,
rb_str_new2(rb_sourcefile())); rb_str_new2(rb_sourcefile()));
rbtk_win32_SetHINSTANCE(RSTRING_PTR(basename)); rbtk_win32_SetHINSTANCE(RSTRING_PTR(basename));
RB_GC_GUARD(basename);
} }
#endif #endif
set_rubytk_kitpath(rb_sourcefile()); set_rubytk_kitpath(rb_sourcefile());