From 5be99e2ee1a17028574fcbd90b9ba2c09555585e Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Fri, 18 Jun 1999 23:15:18 -0400 Subject: snapshot of project "lynx", label v2-8-3dev_2 --- WWW/Library/Implementation/HTAnchor.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'WWW/Library/Implementation/HTAnchor.c') diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c index 22af2bfb..ba131155 100644 --- a/WWW/Library/Implementation/HTAnchor.c +++ b/WWW/Library/Implementation/HTAnchor.c @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -75,6 +76,10 @@ PRIVATE HTParentAnchor * HTParentAnchor_new NOARGS newAnchor->isISMAPScript = FALSE; /* Lynx appends ?0,0 if TRUE. - FM */ newAnchor->isHEAD = FALSE; /* HEAD request if TRUE. - FM */ newAnchor->safe = FALSE; /* Safe. - FM */ +#ifdef SOURCE_CACHE + newAnchor->source_cache_file = NULL; + newAnchor->source_cache_chunk = NULL; +#endif newAnchor->FileCache = NULL; /* Path to a disk-cached copy. - FM */ newAnchor->SugFname = NULL; /* Suggested filename. - FM */ newAnchor->RevTitle = NULL; /* TITLE for a LINK with REV. - FM */ @@ -689,6 +694,22 @@ PUBLIC BOOL HTAnchor_delete ARGS1( FREE(me->bookmark); FREE(me->owner); FREE(me->RevTitle); +#ifdef SOURCE_CACHE + /* + * Clean up the source cache, if any. + */ + if (me->source_cache_file) { + CTRACE(tfp, "Removing source cache file %s\n", + me->source_cache_file); + LYRemoveTemp(me->source_cache_file); + FREE(me->source_cache_file); + } + if (me->source_cache_chunk) { + CTRACE(tfp, "Removing memory source cache %p\n", + (void *)me->source_cache_chunk); + HTChunkFree(me->source_cache_chunk); + } +#endif if (me->FileCache) { FILE *fd; if ((fd = fopen(me->FileCache, "r")) != NULL) { -- cgit 1.4.1-2-gfad0