Fix the fix for Bug#6426 (Bug#7210), avoiding frame garbaging loop.
authorChong Yidong <cyd@stupidchicken.com>
Fri, 5 Nov 2010 18:28:19 +0000 (14:28 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Fri, 5 Nov 2010 18:28:19 +0000 (14:28 -0400)
* image.c (free_image): Don't garbage the frame here, since this
function can be called while redisplaying (Bug#7210).
(uncache_image): Garbage the frame here (Bug#6426).

src/ChangeLog
src/image.c

index b803582..cba2b4b 100644 (file)
@@ -1,3 +1,9 @@
+2010-11-05  Chong Yidong  <cyd@stupidchicken.com>
+
+       * image.c (free_image): Don't garbage the frame here, since this
+       function can be called while redisplaying (Bug#7210).
+       (uncache_image): Garbage the frame here (Bug#6426).
+
 2010-11-04  Chong Yidong  <cyd@stupidchicken.com>
 
        * process.c (Fmake_network_process): Don't apply Bug#5173 fix for
index e7db3a7..0fa0a0c 100644 (file)
@@ -1094,10 +1094,6 @@ free_image (f, img)
       /* Free resources, then free IMG.  */
       img->type->free (f, img);
       xfree (img);
-
-      /* As display glyphs may still be referring to the image ID, we
-        must garbage the frame (Bug#6426).  */
-      SET_FRAME_GARBAGED (f);
     }
 }
 
@@ -1544,7 +1540,12 @@ uncache_image (f, spec)
 {
   struct image *img = search_image_cache (f, spec, sxhash (spec, 0));
   if (img)
-    free_image (f, img);
+    {
+      free_image (f, img);
+      /* As display glyphs may still be referring to the image ID, we
+        must garbage the frame (Bug#6426).  */
+      SET_FRAME_GARBAGED (f);
+    }
 }