st/xorg: Only unreference texture on pixmap destruction, don't destroy it.
authorMichel Dänzer <daenzer@vmware.com>
Tue, 15 Sep 2009 16:31:07 +0000 (18:31 +0200)
committerMichel Dänzer <daenzer@vmware.com>
Tue, 15 Sep 2009 16:31:07 +0000 (18:31 +0200)
Fixes memory corruption if e.g. the driver still has references to the texture.

src/gallium/state_trackers/xorg/xorg_exa.c

index 88149b9d5c1c74a7c375c22c776dcde5ef949a02..75524891f7a2d4495f741dec3fb48bdf9d866030 100644 (file)
@@ -466,14 +466,11 @@ static void
 ExaDestroyPixmap(ScreenPtr pScreen, void *dPriv)
 {
     struct exa_pixmap_priv *priv = (struct exa_pixmap_priv *)dPriv;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    modesettingPtr ms = modesettingPTR(pScrn);
 
     if (!priv)
        return;
 
-    if (priv->tex)
-       ms->screen->texture_destroy(priv->tex);
+    pipe_texture_reference(&priv->tex, NULL);
 
     xfree(priv);
 }