[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] wxPython and cleaning up pygame threads



Hey guys,

I'm running a pygame thread in my wxPython app. If I try to run the
pygame thread a second time I get an error when I try to font.render -
"Text has zero width" ... A search tells me that this can happen since
font.render is not thread safe, but I've killed the previous thread.
If I don't attempt font.render the game will run fine any number of
times.

I am calling pygame.init() and pygame.quit() in the pygame thread,
after the thread finishes I am now calling del(thread) as well from
the wx app just in case. I assume something is not getting cleaned up
after exiting the first thread so that the second time in we fail. Am
I missing something?

Is there an alternative to font.render that I could use to write text?

Mark