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)
commit06869cb4d827baed6e240c888a77f82ddb8c27da (patch)
tree8aba12e78c43f82f5cfefd6244ae776ede1b03b1 /generic
parentf1c7ee6c7c89e7751ae90e68a3488e641ff30516 (diff)
downloadtk-06869cb4d827baed6e240c888a77f82ddb8c27da.zip
tk-06869cb4d827baed6e240c888a77f82ddb8c27da.tar.gz
tk-06869cb4d827baed6e240c888a77f82ddb8c27da.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) {