diff options
author | chengyemao <chengyemao> | 2004-12-17 14:27:18 (GMT) |
---|---|---|
committer | chengyemao <chengyemao> | 2004-12-17 14:27:18 (GMT) |
commit | dc35a1319208a687801cc6633b91a4c2bd13f8a3 (patch) | |
tree | 2da4a5cb7ebcff07bbf9fffcb1bf2fcd2d0b64c4 /generic | |
parent | 0a95731ad184dfbb69abe6165b9e34ab02716511 (diff) | |
download | tk-dc35a1319208a687801cc6633b91a4c2bd13f8a3.zip tk-dc35a1319208a687801cc6633b91a4c2bd13f8a3.tar.gz tk-dc35a1319208a687801cc6633b91a4c2bd13f8a3.tar.bz2 |
bug fix (831627)
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkWindow.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 3172d81..c71f8a0 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWindow.c,v 1.64 2004/03/26 14:45:07 dkf Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.65 2004/12/17 14:27:18 chengyemao Exp $ */ #include "tkPort.h" @@ -355,12 +355,6 @@ CreateTopLevelWindow(interp, parent, name, screenName, flags) Tk_CreatePhotoImageFormat(&tkImgFmtGIF); Tk_CreatePhotoImageFormat(&tkImgFmtPPM); - /* - * Create exit handler to delete all windows when the application - * exits. - */ - - TkCreateExitHandler(DeleteWindowsExitProc, (ClientData) tsdPtr); } if ((parent != NULL) && (screenName != NULL) && (screenName[0] == '\0')) { @@ -3161,6 +3155,17 @@ Initialize(interp) */ code = TkpInit(interp); + if(code != TCL_OK) { + goto done; + } + + /* + * Create exit handler to delete all windows when the application + * exits. This handler needs to be invoked before other platform + * specific cleanups take place to avoid panics in finalization. + */ + + TkCreateExitHandler(DeleteWindowsExitProc, (ClientData) tsdPtr); done: if (argv != NULL) { |