summaryrefslogtreecommitdiff
path: root/xserver/Xext/shm.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2014-11-22 08:33:47 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2014-11-22 08:33:47 +0000
commitc1cddfee651789d9b11e4eeaa4ea2fcfb9ad8bcb (patch)
tree23e5b2c6ab8b2c169fff2e94dbc7c2878cdf034e /xserver/Xext/shm.c
parentfb2ead5cf835f4775839ddf3bd6d4967f11ac599 (diff)
Update to xserver 1.16.2
Diffstat (limited to 'xserver/Xext/shm.c')
-rw-r--r--xserver/Xext/shm.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/xserver/Xext/shm.c b/xserver/Xext/shm.c
index 4dad8b6c6..b78791836 100644
--- a/xserver/Xext/shm.c
+++ b/xserver/Xext/shm.c
@@ -248,21 +248,20 @@ ShmDestroyPixmap(PixmapPtr pPixmap)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
+ void *shmdesc = NULL;
Bool ret;
- if (pPixmap->refcnt == 1) {
- ShmDescPtr shmdesc;
-
- shmdesc = (ShmDescPtr) dixLookupPrivate(&pPixmap->devPrivates,
- shmPixmapPrivateKey);
- if (shmdesc)
- ShmDetachSegment((void *) shmdesc, pPixmap->drawable.id);
- }
+ if (pPixmap->refcnt == 1)
+ shmdesc = dixLookupPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey);
pScreen->DestroyPixmap = screen_priv->destroyPixmap;
ret = (*pScreen->DestroyPixmap) (pPixmap);
screen_priv->destroyPixmap = pScreen->DestroyPixmap;
pScreen->DestroyPixmap = ShmDestroyPixmap;
+
+ if (shmdesc)
+ ShmDetachSegment(shmdesc, pPixmap->drawable.id);
+
return ret;
}