[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] wxPython and cleaning up pygame threads
- To: pygame-users@xxxxxxxx
- Subject: [pygame] wxPython and cleaning up pygame threads
- From: Mark Reed <markreed99@xxxxxxxxx>
- Date: Sat, 19 Dec 2009 15:25:17 +0800
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sat, 19 Dec 2009 02:25:20 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=x7SrynWciaDBzCJM8BkY13dSeScs4ocHsvyRrNWtjJ8=; b=wr1Ocko37Jc2MAP/emmc4S5R4fAHx8fvWa9AndSB4HARi7oomoM5r2XtNCJiL1r0k6 mYp8qdvDJew7tXqiolXqrh3aJW4erekkxTdoMo2pFReGn9TdpI1z00WAOJhOef+Zpm9Z zjXCqIqhahDB043idZISMg82cSbCnJ7DxDQgc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=pfoJP7jRMC5F2JtUVYP2romVhWVHg5bePdUoQ61THpVrjU7T6ybqOEwmoRsicAvXA+ w80DRLUjbINrKXsx0pSII5VU0OwAy56aEIAsspjPzMU/JbErS9T4ojZ5d2BK3TZRtbHF 9hGokVpHI7okuKD7Sxu//dbHldrBG4eLB1My4=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
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