Fix an infinite loop error that may occur when many contexts are bound
authorThomas Hellström <thomas@tungstengraphics.com>
Fri, 1 Dec 2006 12:41:43 +0000 (12:41 +0000)
committerThomas Hellström <thomas@tungstengraphics.com>
Fri, 1 Dec 2006 12:41:43 +0000 (12:41 +0000)
to the same drawable in a multithreading environment. This one slipped out
of the texman merge.

src/mesa/drivers/dri/common/dri_util.c

index e7f07569f4e21860386b4d19357b994c2868b6e5..ba251a814304a0efefdd5d63fec7ba5836f699b2 100644 (file)
@@ -411,13 +411,18 @@ __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp)
     
     if (!pcp 
        || ((pdp != pcp->driDrawablePriv) && (pdp != pcp->driReadablePriv))) {
-       /* ERROR!!! */
-       return;
+       /* ERROR!!! 
+        * ...but we must ignore it. There can be many contexts bound to a
+        * drawable.
+        */
     }
 
     psp = pdp->driScreenPriv;
     if (!psp) {
        /* ERROR!!! */
+       _mesa_problem("Warning! Possible infinite loop due to bug "
+                    "in file %s, line %d\n",
+                    __FILE__, __LINE__);
        return;
     }