changeset 734:f28b168cb626

print debug msg before actual unref to avoid dereferencing an invalid pointer
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Sun, 04 Jan 2009 22:44:27 +0100
parents be60b5cf7fa8
children 48b736507093
files src/dicache.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/dicache.c	Sun Jan 04 20:46:00 2009 +0100
+++ b/src/dicache.c	Sun Jan 04 22:44:27 2009 +0100
@@ -356,6 +356,9 @@
 
    dReturn_if_fail ( DicEntry != NULL );
 
+   /* print msg before actual unref to avoid dereferencing an invalid pointer */
+   MSG("a_Dicache_close RefCount=%d\n", DicEntry->RefCount - 1);
+
    if (DicEntry->State < DIC_Close) {
       DicEntry->State = DIC_Close;
       dFree(DicEntry->cmap);
@@ -364,7 +367,6 @@
       DicEntry->DecoderData = NULL;
    }
    a_Dicache_unref(url, version);
-   MSG("a_Dicache_close RefCount=%d\n", DicEntry->RefCount);
 
    a_Bw_close_client(Web->bw, Client->Key);
 }