summaryrefslogtreecommitdiffstats
path: root/ext/tcltklib/tcltklib.c
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-08-31 03:32:33 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-08-31 03:32:33 +0000
commitddbcf372b306177b366676413cc48a1a8d59ac9e (patch)
treec150b4d6f1134f411c971af8d2799fd0ca3a7b9b /ext/tcltklib/tcltklib.c
parent61df72fca52674903362f68c3012277d1fbc97cd (diff)
downloadruby-ddbcf372b306177b366676413cc48a1a8d59ac9e.tar.gz
ruby-ddbcf372b306177b366676413cc48a1a8d59ac9e.tar.xz
ruby-ddbcf372b306177b366676413cc48a1a8d59ac9e.zip
* 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
Diffstat (limited to 'ext/tcltklib/tcltklib.c')
-rw-r--r--ext/tcltklib/tcltklib.c7
1 files changed, 6 insertions, 1 deletions
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;
}