changeset 741:4e3e9a7cb333

Backed out changeset abdae95b1c9e The optimization was causing crashes.
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Fri, 09 Jan 2009 11:05:54 +0100
parents abdae95b1c9e
children 6e89436361f6
files src/dicache.c src/gif.c src/jpeg.c src/png.c
diffstat 4 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/dicache.c	Mon Jan 05 09:38:42 2009 -0300
+++ b/src/dicache.c	Fri Jan 09 11:05:54 2009 +0100
@@ -388,12 +388,10 @@
       Client->Version = DicEntry->version;
 
    /* Only call the decoder when necessary */
-   int newData = FALSE;
    if (Op == CA_Send && DicEntry->State < DIC_Close &&
        DicEntry->DecodedSize < Client->BufSize) {
       DicEntry->Decoder(Op, Client);
       DicEntry->DecodedSize = Client->BufSize;
-      newData = TRUE;
    } else if (Op == CA_Close || Op == CA_Abort) {
       if (DicEntry->State < DIC_Close) {
          DicEntry->Decoder(Op, Client);
@@ -411,7 +409,7 @@
             DicEntry->version, DicEntry->width, DicEntry->height,
             DicEntry->type);
       }
-      if (DicEntry->State == DIC_Write && newData) {
+      if (DicEntry->State == DIC_Write) {
          if (DicEntry->ScanNumber == Image->ScanNumber) {
             for (i = 0; i < DicEntry->height; ++i)
                if (a_Bitvec_get_bit(DicEntry->BitVec, (int)i) &&
@@ -452,8 +450,8 @@
       node = dList_nth_data(CachedIMGs, i);
       /* iterate each entry of this node */
       for (entry = node->first; entry; entry = entry->next) {
-         if (entry->RefCount == 1 ||
-             (entry->v_imgbuf && a_Imgbuf_last_reference(entry->v_imgbuf))) {
+         if (entry->v_imgbuf &&
+             a_Imgbuf_last_reference(entry->v_imgbuf)) {
             /* free this unused entry */
             if (entry->next) {
                Dicache_remove(node->url, entry->version);
--- a/src/gif.c	Mon Jan 05 09:38:42 2009 -0300
+++ b/src/gif.c	Fri Jan 09 11:05:54 2009 +0100
@@ -179,7 +179,6 @@
       DicEntry = a_Dicache_add_entry(web->url);
       DicEntry->DecoderData =
          Gif_new(web->Image, DicEntry->url, DicEntry->version);
-      a_Dicache_ref(DicEntry->url, DicEntry->version);
    } else {
       /* Repeated image */
       a_Dicache_ref(DicEntry->url, DicEntry->version);
--- a/src/jpeg.c	Mon Jan 05 09:38:42 2009 -0300
+++ b/src/jpeg.c	Fri Jan 09 11:05:54 2009 +0100
@@ -123,7 +123,6 @@
       DicEntry = a_Dicache_add_entry(web->url);
       DicEntry->DecoderData =
          Jpeg_new(web->Image, DicEntry->url, DicEntry->version);
-      a_Dicache_ref(DicEntry->url, DicEntry->version);
    } else {
       /* Repeated image */
       a_Dicache_ref(DicEntry->url, DicEntry->version);
--- a/src/png.c	Mon Jan 05 09:38:42 2009 -0300
+++ b/src/png.c	Fri Jan 09 11:05:54 2009 +0100
@@ -474,7 +474,6 @@
       DicEntry = a_Dicache_add_entry(web->url);
       DicEntry->DecoderData =
          Png_new(web->Image, DicEntry->url, DicEntry->version);
-      a_Dicache_ref(DicEntry->url, DicEntry->version);
    } else {
       /* Repeated image */
       a_Dicache_ref(DicEntry->url, DicEntry->version);