[PyOpenGL-Users] threading porblem leads to segfaults (with wxpython)
Brought to you by:
mcfletch
From: Alexander G. <Ale...@tu...> - 2007-03-27 22:19:38
|
Hi list! I've got a little problem with following code. (extra for you stripped down to the minimum) <snip> #!/usr/bin/env python from OpenGL.GL import * import threading from time import sleep from wx import wx from wx import glcanvas class foo(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.canvas = glcanvas.GLCanvas(frame, pos =(0,0), size= (100,100)) self.canvas.SetCurrent() def run(self): while True: glFlush() # dies here sleep(1) app = wx.PySimpleApp() frame = wx.Frame(None, -1, "blafasel",(100,100)) t = foo() frame.Show(True) t.start() #dies # glFlush() #lives app.MainLoop() </snip> which gives following error message <snip> imtrey% ./test2.py zsh: segmentation fault (core dumped) ./test2.py imtrey% </snip> Which does not happen, if I don't start the foo thread but call glFlush alone. Can someone please point me to my mistake? Best wishes, alex |