Hi Trevor,

Thus spoketh "Trevor J. Christensen" <tre...@jcmanagement.net> 
unto us on Wed, 9 Feb 2011 09:54:13 -0700:

> Under Windows XP, the following simple program crashes after 20 seconds
> or so with the following error:
>  
> TclStackFree: incorrect freePtr. Call out of sequence?
>  
> It behaves the same under python 2.6 and python 2.7.
>  
> I suspect it has something to do with Tk/Tcl's multithreading model.  I
> did discover that if you comment out the vertical scrollbar code, this
> program will run fine.  I could use some help here in figuring out what
> the problem is.

The problem is that you must _n e  v e r_ access the tk event loop from
more than one thread.
The best practice is to always run the mainloop () within the main program
thread and, if child threads are really necessary, to use e.g.
threading.Condition or Queue.Queue objects to handle the communication
between Tkinter and the child thread.

Regards

Michael




.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Without facts, the decision cannot be made logically.  You must rely on
your human intuition.
                -- Spock, "Assignment: Earth", stardate unknown
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to