swrast: do depth/stencil clearing with Map/UnmapRenderbuffer()
[mesa.git] / src / glx / drisw_glx.c
index f6aeda90abb5452f6936a1c2a084272ddd16d808..204879efeca7e0485e51bb19fcab8fda26258c9e 100644 (file)
@@ -253,9 +253,6 @@ drisw_destroy_context(struct glx_context *context)
 
    driReleaseDrawables(&pcp->base);
 
-   if (context->xid)
-      glx_send_destroy_context(psc->base.dpy, context->xid);
-
    if (context->extensions)
       XFree((char *) context->extensions);
 
@@ -383,6 +380,13 @@ drisw_create_context(struct glx_screen *base,
       return NULL;
 
    if (shareList) {
+      /* If the shareList context is not a DRISW context, we cannot possibly
+       * create a DRISW context that shares it.
+       */
+      if (shareList->vtable->destroy != drisw_destroy_context) {
+        return NULL;
+      }
+
       pcp_shared = (struct drisw_context *) shareList;
       shared = pcp_shared->driContext;
    }