diff options
author | hobbs <hobbs> | 2003-01-03 22:43:45 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2003-01-03 22:43:45 (GMT) |
commit | 49c51cd1627b228e3282db5386000bbb9e068268 (patch) | |
tree | 8aba12e78c43f82f5cfefd6244ae776ede1b03b1 /generic/tkFrame.c | |
parent | 43fb605168cd88ae04a16fff8da6bc7dacbdaf30 (diff) | |
download | tk-49c51cd1627b228e3282db5386000bbb9e068268.zip tk-49c51cd1627b228e3282db5386000bbb9e068268.tar.gz tk-49c51cd1627b228e3282db5386000bbb9e068268.tar.bz2 |
* generic/tkFrame.c (CreateFrame): throw a Tcl error instead of a
panic when we cannot get a main window and appname is NULL. This
can indicate that a user tried to create a frame/toplevel while Tk
was dying. [Bug #661792]
Diffstat (limited to 'generic/tkFrame.c')
-rw-r--r-- | generic/tkFrame.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/generic/tkFrame.c b/generic/tkFrame.c index d5ed063..63e8245 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.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: tkFrame.c,v 1.13 2002/08/05 04:30:38 dgp Exp $ + * RCS: @(#) $Id: tkFrame.c,v 1.14 2003/01/03 22:43:45 hobbs Exp $ */ #include "default.h" @@ -565,14 +565,20 @@ CreateFrame(clientData, interp, objc, objv, type, appName) if (tkwin != NULL) { new = Tk_CreateWindowFromPath(interp, tkwin, Tcl_GetString(objv[1]), screenName); + } else if (appName == NULL) { + /* + * This occurs when someone tried to create a frame/toplevel + * while we are being destroyed. Let an error be thrown. + */ + + Tcl_AppendResult(interp, "unable to create widget \"", + Tcl_GetString(objv[1]), "\"", (char *) NULL); + new = NULL; } else { /* * We were called from Tk_Init; create a new application. */ - if (appName == NULL) { - panic("TkCreateFrame didn't get application name"); - } new = TkCreateMainWindow(interp, screenName, appName); } if (new == NULL) { |