summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2003-01-03 22:43:45 (GMT)
committerhobbs <hobbs>2003-01-03 22:43:45 (GMT)
commit891029fe3efdaa4b484b55a7d937c4e2d39b7722 (patch)
tree8aba12e78c43f82f5cfefd6244ae776ede1b03b1 /generic
parent5765ca0d5beb52496528ec6fc4da96dcee1d9f3d (diff)
downloadtk-891029fe3efdaa4b484b55a7d937c4e2d39b7722.zip
tk-891029fe3efdaa4b484b55a7d937c4e2d39b7722.tar.gz
tk-891029fe3efdaa4b484b55a7d937c4e2d39b7722.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')
-rw-r--r--generic/tkFrame.c14
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) {