<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - [snb][regression] Crash when scaling Java application window"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=85058#c17">Comment # 17</a>
              on <a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - [snb][regression] Crash when scaling Java application window"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=85058">bug 85058</a>
              from <span class="vcard"><a class="email" href="mailto:chris@chris-wilson.co.uk" title="Chris Wilson <chris@chris-wilson.co.uk>"> <span class="fn">Chris Wilson</span></a>
</span></b>
        <pre>The root cause should be fixed by:

diff --git a/Xext/shm.c b/Xext/shm.c
index b2ede99..f5562c0 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -281,21 +281,21 @@ ShmDestroyPixmap(PixmapPtr pPixmap)
 {
     ScreenPtr pScreen = pPixmap->drawable.pScreen;
     ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
+    ShmDescPtr shmdesc = NULL;
     Bool ret;

-    if (pPixmap->refcnt == 1) {
-        ShmDescPtr shmdesc;
-
+    if (pPixmap->refcnt == 1)
         shmdesc = (ShmDescPtr) dixLookupPrivate(&pPixmap->devPrivates,
                                                 shmPixmapPrivateKey);
-        if (shmdesc)
-            ShmDetachSegment((void *) shmdesc, pPixmap->drawable.id);
-    }

     pScreen->DestroyPixmap = screen_priv->destroyPixmap;
     ret = (*pScreen->DestroyPixmap) (pPixmap);
     screen_priv->destroyPixmap = pScreen->DestroyPixmap;
     pScreen->DestroyPixmap = ShmDestroyPixmap;
+
+    if (shmdesc)
+       ShmDetachSegment((void *) shmdesc, pPixmap->drawable.id);
+
     return ret;
 }</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>