From ddbcf372b306177b366676413cc48a1a8d59ac9e Mon Sep 17 00:00:00 2001 From: nagai Date: Tue, 31 Aug 2004 03:32:33 +0000 Subject: * ext/tcltklib/tcltklib.c (del_root): fix SEGV git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ ext/tcltklib/tcltklib.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4b689b8c2..e33e00945 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Aug 31 12:30:36 2004 Hidetoshi NAGAI + + * ext/tcltklib/tcltklib.c (del_root): fix SEGV + Mon Aug 30 21:50:14 2004 Dave Thomas * object.c: Add RDoc for Module.included. diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c index 0217ab8fe..84a999d7e 100644 --- a/ext/tcltklib/tcltklib.c +++ b/ext/tcltklib/tcltklib.c @@ -2781,8 +2781,13 @@ ip_thread_tkwait(self, mode, target) VALUE del_root(ip) Tcl_Interp *ip; { + Tk_Window main_win; + Tcl_Preserve(ip); - Tk_DestroyWindow(Tk_MainWindow(ip)); + main_win = Tk_MainWindow(ip); + if (main_win != (Tk_Window)NULL) { + Tk_DestroyWindow(main_win); + } Tcl_Release(ip); return Qnil; } -- cgit