summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-05-29 01:42:34 (GMT)
committerhobbs <hobbs>2000-05-29 01:42:34 (GMT)
commit2d67e18ce8dc3d8eba46908a9446afba165d30ac (patch)
treeee5d2156713c6b0635de361330ba598da714fba4 /generic
parent57153a20927965e81e319e1ce58e1ef5c4792845 (diff)
downloadtk-2d67e18ce8dc3d8eba46908a9446afba165d30ac.zip
tk-2d67e18ce8dc3d8eba46908a9446afba165d30ac.tar.gz
tk-2d67e18ce8dc3d8eba46908a9446afba165d30ac.tar.bz2
* generic/tkPlace.c (Tk_PlaceCmd): reworked place master/slave
table init'n to prevent seg fault when using place on multiple displays.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkPlace.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/generic/tkPlace.c b/generic/tkPlace.c
index 174a022..6521f9e 100644
--- a/generic/tkPlace.c
+++ b/generic/tkPlace.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkPlace.c,v 1.5 1999/04/21 21:53:27 rjohnson Exp $
+ * RCS: @(#) $Id: tkPlace.c,v 1.6 2000/05/29 01:42:34 hobbs Exp $
*/
#include "tkPort.h"
@@ -161,18 +161,6 @@ Tk_PlaceCmd(clientData, interp, argc, argv)
int c;
TkDisplay *dispPtr;
- dispPtr = ((TkWindow *) clientData)->dispPtr;
-
- /*
- * Initialize, if that hasn't been done yet.
- */
-
- if (!dispPtr->placeInit) {
- Tcl_InitHashTable(&dispPtr->masterTable, TCL_ONE_WORD_KEYS);
- Tcl_InitHashTable(&dispPtr->slaveTable, TCL_ONE_WORD_KEYS);
- dispPtr->placeInit = 1;
- }
-
if (argc < 3) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
argv[0], " option|pathName args", (char *) NULL);
@@ -190,6 +178,18 @@ Tk_PlaceCmd(clientData, interp, argc, argv)
if (tkwin == NULL) {
return TCL_ERROR;
}
+
+ /*
+ * Initialize, if that hasn't been done yet.
+ */
+
+ dispPtr = ((TkWindow *) tkwin)->dispPtr;
+ if (!dispPtr->placeInit) {
+ Tcl_InitHashTable(&dispPtr->masterTable, TCL_ONE_WORD_KEYS);
+ Tcl_InitHashTable(&dispPtr->slaveTable, TCL_ONE_WORD_KEYS);
+ dispPtr->placeInit = 1;
+ }
+
slavePtr = FindSlave(tkwin);
return ConfigureSlave(interp, slavePtr, argc-2, argv+2);
}
@@ -203,6 +203,18 @@ Tk_PlaceCmd(clientData, interp, argc, argv)
if (tkwin == NULL) {
return TCL_ERROR;
}
+
+ /*
+ * Initialize, if that hasn't been done yet.
+ */
+
+ dispPtr = ((TkWindow *) tkwin)->dispPtr;
+ if (!dispPtr->placeInit) {
+ Tcl_InitHashTable(&dispPtr->masterTable, TCL_ONE_WORD_KEYS);
+ Tcl_InitHashTable(&dispPtr->slaveTable, TCL_ONE_WORD_KEYS);
+ dispPtr->placeInit = 1;
+ }
+
if ((c == 'c') && (strncmp(argv[1], "configure", length) == 0)) {
if (argc < 5) {
Tcl_AppendResult(interp, "wrong # args: should be \"",