diff src/image.c @ 111372:0792cbcb42ed

Fix the fix for Bug#6426 (Bug#7210), avoiding frame garbaging loop. * 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).
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 05 Nov 2010 14:28:19 -0400
parents f969130f2bb4
children 132f2dfd549f 704900942a8e
line wrap: on
line diff
--- a/src/image.c	Thu Nov 04 16:34:49 2010 -0400
+++ b/src/image.c	Fri Nov 05 14:28:19 2010 -0400
@@ -1094,10 +1094,6 @@
       /* 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 @@
 {
   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);
+    }
 }