aboutsummaryrefslogtreecommitdiffstats
path: root/ext/tk/tcltklib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/tcltklib.c')
-rw-r--r--ext/tk/tcltklib.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index 40d546ea9d..f082d3922f 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -6374,10 +6374,11 @@ ip_create_slave_core(interp, argc, argv)
VALUE *argv;
{
struct tcltkip *master = get_ip(interp);
- struct tcltkip *slave = ALLOC(struct tcltkip);
+ struct tcltkip *slave;
/* struct tcltkip *slave = RbTk_ALLOC_N(struct tcltkip, 1); */
VALUE safemode;
VALUE name;
+ VALUE new_ip;
int safe;
int thr_crit_bup;
Tk_Window mainWin;
@@ -6416,6 +6417,8 @@ ip_create_slave_core(interp, argc, argv)
}
#endif
+ new_ip = TypedData_Make_Struct(CLASS_OF(interp), struct tcltkip,
+ &tcltkip_type, slave);
/* create slave-ip */
#ifdef RUBY_USE_NATIVE_THREAD
/* slave->tk_thread_id = 0; */
@@ -6475,7 +6478,7 @@ ip_create_slave_core(interp, argc, argv)
rb_thread_critical = thr_crit_bup;
- return TypedData_Wrap_Struct(CLASS_OF(interp), &tcltkip_type, slave);
+ return new_ip;
}
static VALUE