diff options
author | chengyemao <chengyemao> | 2004-12-17 14:27:18 (GMT) |
---|---|---|
committer | chengyemao <chengyemao> | 2004-12-17 14:27:18 (GMT) |
commit | 7512b919d9078b0b4b006e75e5f3e876cfb763db (patch) | |
tree | 2da4a5cb7ebcff07bbf9fffcb1bf2fcd2d0b64c4 /generic/tkWindow.c | |
parent | f81c3e0fff19f8c4e34bbcfbfa3b3491958231ef (diff) | |
download | tk-7512b919d9078b0b4b006e75e5f3e876cfb763db.zip tk-7512b919d9078b0b4b006e75e5f3e876cfb763db.tar.gz tk-7512b919d9078b0b4b006e75e5f3e876cfb763db.tar.bz2 |
bug fix (831627)
Diffstat (limited to 'generic/tkWindow.c')
-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) { |