aboutsummaryrefslogtreecommitdiff
path: root/src/png.c
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2009-01-01 10:06:48 -0300
committerJorge Arellano Cid <jcid@dillo.org>2009-01-01 10:06:48 -0300
commit9783b0f015c4437f1c3c457caacaecadc06ae644 (patch)
tree84c3ba69d48f3840799e8096077ba03778254108 /src/png.c
parenta242c0021263fc48fa57d1e4c1a874713745f590 (diff)
imported patch dicache-cleanup5
Diffstat (limited to 'src/png.c')
-rw-r--r--src/png.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/png.c b/src/png.c
index dee8d5b4..989809e8 100644
--- a/src/png.c
+++ b/src/png.c
@@ -304,12 +304,13 @@ static void
*/
static void Png_close(DilloPng *png, CacheClient_t *Client)
{
- /* Free up the resources for this image */
+ /* Let dicache know decoding is over */
a_Dicache_close(png->url, png->version, Client);
+
+ /* Free up the resources for this image */
dFree(png->image_data);
dFree(png->row_pointers);
dFree(png->linebuf);
-
if (setjmp(png->jmpbuf))
MSG_WARN("PNG: can't destroy read structure\n");
else if (png->png_ptr)
@@ -444,8 +445,9 @@ static DilloPng *Png_new(DilloImage *Image, DilloUrl *url, int version)
}
/*
- * MIME handler for "image/png" type
- * (Sets Png_callback or a_Dicache_callback as the cache-client)
+ * MIME handler for "image/png" type.
+ * Sets a_Dicache_callback as the cache-client,
+ * and Png_callback as the image decoder.
*
* Parameters:
* Type: MIME type
@@ -465,7 +467,7 @@ void *a_Png_image(const char *Type, void *Ptr, CA_Callback_t *Call,
/* Add an extra reference to the Image (for dicache usage) */
a_Image_ref(web->Image);
- DicEntry = a_Dicache_get_entry(web->url);
+ DicEntry = a_Dicache_get_entry(web->url, DIC_Last);
if (!DicEntry) {
/* Let's create an entry for this image... */
DicEntry = a_Dicache_add_entry(web->url);