glamor: Free resources when destroying pixmaps.

This commit is contained in:
Eric Anholt 2009-08-20 16:43:03 -07:00 committed by Zhigang Gong
parent 16c3b929dd
commit 2fa26c4958

View File

@ -121,6 +121,13 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
static Bool
glamor_destroy_pixmap(PixmapPtr pixmap)
{
if (pixmap->refcnt == 1) {
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
glDeleteFramebuffersEXT(1, &pixmap_priv->fb);
glDeleteTextures(1, &pixmap_priv->tex);
}
return fbDestroyPixmap(pixmap);
}