drisw: dead store removal
[mesa.git] / src / glx / drisw_glx.c
index c5b179157b3edaf2f423a39a889c2bf42411335b..e8cc4c83e06ea25c3333597232f12e703fa66f90 100644 (file)
@@ -128,13 +128,11 @@ swrastGetDrawableInfo(__DRIdrawable * draw,
    Drawable drawable;
 
    Window root;
-   Status stat;
    unsigned uw, uh, bw, depth;
 
    drawable = pdraw->xDrawable;
 
-   stat = XGetGeometry(dpy, drawable, &root,
-                       x, y, &uw, &uh, &bw, &depth);
+   XGetGeometry(dpy, drawable, &root, x, y, &uw, &uh, &bw, &depth);
    *w = uw;
    *h = uh;
 }
@@ -250,8 +248,6 @@ drisw_destroy_context(struct glx_context *context)
    if (context->extensions)
       XFree((char *) context->extensions);
 
-   GarbageCollectDRIDrawables(context->psc);
-
    (*psc->core->destroyContext) (pcp->driContext);
 
    Xfree(pcp);
@@ -285,6 +281,8 @@ drisw_unbind_context(struct glx_context *context, struct glx_context *new)
    struct drisw_screen *psc = (struct drisw_screen *) pcp->base.psc;
 
    (*psc->core->unbindContext) (pcp->driContext);
+
+   driReleaseDrawables(&pcp->base);
 }
 
 static const struct glx_context_vtable drisw_context_vtable = {
@@ -452,8 +450,10 @@ driCreateScreen(int screen, struct glx_display *priv)
       return NULL;
 
    memset(psc, 0, sizeof *psc);
-   if (!glx_screen_init(&psc->base, screen, priv))
-       return NULL;
+   if (!glx_screen_init(&psc->base, screen, priv)) {
+      Xfree(psc);
+      return NULL;
+   }
 
    psc->driver = driOpenSwrast();
    if (psc->driver == NULL)
@@ -504,6 +504,7 @@ driCreateScreen(int screen, struct glx_display *priv)
  handle_error:
    if (psc->driver)
       dlclose(psc->driver);
+   glx_screen_cleanup(&psc->base);
    Xfree(psc);
 
    ErrorMessageF("reverting to indirect rendering\n");