summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorNian Wu <[email protected]>2007-03-15 17:00:22 +0800
committerNian Wu <[email protected]>2007-03-15 17:00:22 +0800
commitd63eef4b86af02aea5b26f90de9cf3d46aee398c (patch)
tree3923da93925a0c3de4222dbcc45411813e3ff1a5 /src/mesa/drivers
parent805b1cf4821aa807ce0f87d03dc464c0ee01a33a (diff)
parent32d196820f5669a03bfd1adde1352b857ffda3b6 (diff)
Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/x11/xm_api.c6
-rw-r--r--src/mesa/drivers/x11/xm_buffer.c9
2 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index 776928dec4d..cbbbd56efd5 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -483,6 +483,12 @@ xmesa_free_buffer(XMesaBuffer buffer)
/* mark as delete pending */
fb->DeletePending = GL_TRUE;
+
+ /* Since the X window for the XMesaBuffer is going away, we don't
+ * want to dereference this pointer in the future.
+ */
+ b->frontxrb->drawable = 0;
+
/* Unreference. If count = zero we'll really delete the buffer */
_mesa_unreference_framebuffer(&fb);
diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c
index 747971a6c30..73c46b1fe60 100644
--- a/src/mesa/drivers/x11/xm_buffer.c
+++ b/src/mesa/drivers/x11/xm_buffer.c
@@ -362,16 +362,13 @@ xmesa_delete_framebuffer(struct gl_framebuffer *fb)
{
XMesaBuffer b = XMESA_BUFFER(fb);
-#ifdef XFree86Server
- int client = 0;
- if (b->frontxrb->drawable)
- client = CLIENT_ID(b->frontxrb->drawable->id);
-#endif
-
if (b->num_alloced > 0) {
/* If no other buffer uses this X colormap then free the colors. */
if (!xmesa_find_buffer(b->display, b->cmap, b)) {
#ifdef XFree86Server
+ int client = 0;
+ if (b->frontxrb->drawable)
+ client = CLIENT_ID(b->frontxrb->drawable->id);
(void)FreeColors(b->cmap, client,
b->num_alloced, b->alloced_colors, 0);
#else