diff options
author | Pierre Willenbrock <pierre@pirsoft.de> | 2008-02-07 21:28:28 +0100 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2008-02-14 23:48:46 +0000 |
commit | cd78f0d0fc08e4e2339ed09dad1a12802de7729c (patch) | |
tree | 12f460b0cc3bd994e5a8c61cd1992a36f07e922f /GL | |
parent | 3e0353c78571890f849a1db47b0540aacc6793bc (diff) |
AIGLX: Fix crash after client using GLX_EXT_texture_from_pixmap died.
Diffstat (limited to 'GL')
-rw-r--r-- | GL/glx/glxdri.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c index 6c1a199f7..e405ee06f 100644 --- a/GL/glx/glxdri.c +++ b/GL/glx/glxdri.c @@ -185,6 +185,42 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable) { __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; + int i; + + for (i = 0; i < screenInfo.numScreens; i++) { + __GLXDRIscreen * const screen = (__GLXDRIscreen *) + glxGetScreen(screenInfo.screens[i]); + + GLuint lastOverride = screen->lastTexOffsetOverride; + + if (lastOverride) { + __GLXDRIdrawable **texOffsetOverride = screen->texOffsetOverride; + int i; + + for (i = 0; i < lastOverride; i++) { + if (texOffsetOverride[i] == private) { + + texOffsetOverride[i] = NULL; + + if (i + 1 == lastOverride) { + lastOverride = 0; + + while (i--) { + if (texOffsetOverride[i]) { + lastOverride = i + 1; + break; + } + } + + screen->lastTexOffsetOverride = lastOverride; + + break; + } + } + } + } + } + (*private->driDrawable.destroyDrawable)(&private->driDrawable); /* If the X window was destroyed, the dri DestroyWindow hook will |