Author: ArcRiley
Date: 2008-02-10 23:28:52 -0500 (Sun, 10 Feb 2008)
New Revision: 847

Modified:
   trunk/pysoy/src/_core-x11/Window.pxi
Log:
Committing unfinished (but working) work to avoid conflict


Modified: trunk/pysoy/src/_core-x11/Window.pxi
===================================================================
--- trunk/pysoy/src/_core-x11/Window.pxi        2008-02-10 10:05:16 UTC (rev 
846)
+++ trunk/pysoy/src/_core-x11/Window.pxi        2008-02-11 04:28:52 UTC (rev 
847)
@@ -46,11 +46,11 @@
 
 
   def __dealloc__(self) :
+    if self._windowID :
+      self._destroy()
     _windows.lock()
     _windows.remove(<void *>self)
     _windows.unlock()
-    if self._windowID :
-      self._destroy()
 
 
   cdef void _create(self, int _xpos, int _ypos, int _width, int _height) :
@@ -108,21 +108,26 @@
 
 
   cdef void _destroy(self) :
-    _windows.lock()
-    glx.XUnmapWindow(_display, self._windowID)
-    glx.XDestroyWindow(_display, self._windowID)
-    glx.XFlush(_display)
-    self._opened = -1
-    _windows.unlock()
+    self._opened = 3
+    while self._opened == 3 :
+      soy._internals._sleep(100)
 
 
   cdef void _coreRender(self) :
     cdef int i
+    if self._opened == 3 :
+      glx.XUnmapWindow(_display, self._windowID)
+      glx.XDestroyWindow(_display, self._windowID)
+      glx.XFlush(_display)
+      self._opened = -1
     if self._opened < 1 :
       return
     glx.glXMakeCurrent(_display, self._windowID, _glxContext)
+    #
+    # This doesn't belong in _coreRender
     if self._screen._glVersion == 0 :
       self._screen._glewInit()
+    #
     gl.glViewport(0, 0, self._width, self._height)
     gl.glClearColor(self._background._r, self._background._g,
                     self._background._b, 1.0)

_______________________________________________
PySoy-SVN mailing list
[email protected]
http://www.pysoy.org/mailman/listinfo/pysoy-svn

Reply via email to