[Xfce4-commits] <ristretto:ristretto-0.0> Make image-cache cache one less image to prevent it from exceeding the maximum size.

Stephan Arts noreply at xfce.org
Sun Oct 23 19:22:39 CEST 2011


Updating branch refs/heads/ristretto-0.0
         to 90f3cc5e0b5941e613defb37160c40d23d952eca (commit)
       from 3464cfd1a1f3343eec307b62650c1c47821c25cf (commit)

commit 90f3cc5e0b5941e613defb37160c40d23d952eca
Author: Stephan Arts <stephan at xfce.org>
Date:   Sat Oct 24 04:38:17 2009 +0200

    Make image-cache cache one less image to prevent it from exceeding the maximum size.

 ChangeLog         |    5 +++++
 src/image_cache.c |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7538415..c0e2a5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-24  Stephan Arts <stephan at xfce.org>
+
+	* src/image_cache.c: Make image-cache cache one less image to prevent it
+	  from exceeding the maximum-size.
+
 2009-10-16  Stephan Arts <stephan at xfce.org>
 
 	* src/thumbnail_bar.c: Implement auto-center
diff --git a/src/image_cache.c b/src/image_cache.c
index f8b61f0..63b5025 100644
--- a/src/image_cache.c
+++ b/src/image_cache.c
@@ -147,6 +147,7 @@ rstto_image_cache_push_image (RsttoImageCache *cache, RsttoImage *image, gboolea
         for (iter = cache->cache_list->next; iter != NULL; iter = g_list_next (iter))
         {
             c_image = iter->data;
+            size = size + rstto_image_get_size (c_image);
             if (size > (guint64)(cache_size*1000000))
             {
                 rstto_image_unload (c_image);
@@ -156,7 +157,6 @@ rstto_image_cache_push_image (RsttoImageCache *cache, RsttoImage *image, gboolea
             } 
             else
             {
-                size = size + rstto_image_get_size (c_image);
                 if (rstto_image_get_size (c_image) == 0)
                 {
                     rstto_image_unload (c_image);


More information about the Xfce4-commits mailing list