Jeff Epler wrote:
> However, on this system, I couldn't recreate the problem you reported
> with either the "using _tkinter directly" instructions, or using this
> "C" test program:
>
> #include <tcl.h>
> #include <tk.h>
>
> int main(void) {
> Tcl_Interp *trp;
> unsetenv("DISPLAY");
> trp = Tcl_CreateInterp();
> printf("%d\n", Tk_Init(trp));
> printf("%d\n", Tk_Init(trp));
> return 0;
> }
The problem only occurs when Tcl and Tk were compiled with
--enable-threads, and it occurs because Tk fails to unlock a mutex
in a few error cases. The patch below fixes the problem.
I'll report it to the Tcl people, and see whether I can work around
in _tkinter.
Regards,
Martin
diff -ur tk8.4.13/generic/tkWindow.c tk8.4.13.modified/generic/tkWindow.c
--- tk8.4.13/generic/tkWindow.c 2006-04-04 23:49:57.000000000 +0200
+++ tk8.4.13.modified/generic/tkWindow.c 2006-04-30 21:41:37.000000000
+0200
@@ -3108,6 +3108,7 @@
Tcl_DStringFree(&class);
if (code != TCL_OK) {
+ Tcl_MutexUnlock(&windowMutex);
goto done;
}
Tcl_ResetResult(interp);
@@ -3124,6 +3125,7 @@
Tcl_SetVar(interp, "geometry", geometry, TCL_GLOBAL_ONLY);
code = Tcl_VarEval(interp, "wm geometry . ", geometry, (char *) NULL);
if (code != TCL_OK) {
+ Tcl_MutexUnlock(&windowMutex);
goto done;
}
geometry = NULL;
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com