diff 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
line wrap: on
line diff
--- a/pytouhou/ui/opengl/renderer.pyx
+++ b/pytouhou/ui/opengl/renderer.pyx
@@ -61,6 +61,9 @@ cdef class Texture:
         for i in xrange(2):
             renderer.indices[key][i] = self.indices[i]
 
+        #XXX: keep a reference so that when __dealloc__ is called self.pointer is still valid.
+        self.renderer = renderer
+
     def __dealloc__(self):
         if self.texture:
             glDeleteTextures(1, &self.texture)