comparison pytouhou/ui/opengl/renderer.pyx @ 537:63440d1e0717

Fix a segfault happening at exit time on Windows.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 19 Apr 2014 19:03:38 +0200
parents dacdcca59b66
children d6d9a711253d
comparison
equal deleted inserted replaced
536:6b76c9ba3975 537:63440d1e0717
59 self.pointer = &renderer.textures[key] 59 self.pointer = &renderer.textures[key]
60 self.pointer[0] = texture 60 self.pointer[0] = texture
61 for i in xrange(2): 61 for i in xrange(2):
62 renderer.indices[key][i] = self.indices[i] 62 renderer.indices[key][i] = self.indices[i]
63 63
64 #XXX: keep a reference so that when __dealloc__ is called self.pointer is still valid.
65 self.renderer = renderer
66
64 def __dealloc__(self): 67 def __dealloc__(self):
65 if self.texture: 68 if self.texture:
66 glDeleteTextures(1, &self.texture) 69 glDeleteTextures(1, &self.texture)
67 if self.pointer != NULL: 70 if self.pointer != NULL:
68 self.pointer[0] = 0 71 self.pointer[0] = 0