diff options
| author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-08-31 03:32:33 +0000 |
|---|---|---|
| committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-08-31 03:32:33 +0000 |
| commit | a3156d549f9db59308db273a9901cb79a05eef80 (patch) | |
| tree | b358dafb9b82d516de00edc33e18f75d3946c90a /ext | |
| parent | 6b65e32e8ca27a6a59f9cac823ad2ed60ff6bf0f (diff) | |
| download | ruby-a3156d549f9db59308db273a9901cb79a05eef80.tar.gz ruby-a3156d549f9db59308db273a9901cb79a05eef80.tar.xz ruby-a3156d549f9db59308db273a9901cb79a05eef80.zip | |
* ext/tcltklib/tcltklib.c (del_root): fix SEGV
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/tcltklib/tcltklib.c | 7 |
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; } |
