From: Michel Dänzer Date: Tue, 15 Sep 2009 16:31:07 +0000 (+0200) Subject: st/xorg: Only unreference texture on pixmap destruction, don't destroy it. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0469465c31371177d85ab7af103359500323c1f8;p=mesa.git st/xorg: Only unreference texture on pixmap destruction, don't destroy it. Fixes memory corruption if e.g. the driver still has references to the texture. --- diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index 88149b9d5c1..75524891f7a 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -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); }