about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/HTAnchor.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1999-06-18 23:15:18 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1999-06-18 23:15:18 -0400
commit5be99e2ee1a17028574fcbd90b9ba2c09555585e (patch)
tree1bfb6d74bcc359caef514b87d4fa3efef62dfe97 /WWW/Library/Implementation/HTAnchor.c
parentc7bfda903760e4bd0d0d8327560f6dee5e1dc059 (diff)
downloadlynx-snapshots-5be99e2ee1a17028574fcbd90b9ba2c09555585e.tar.gz
snapshot of project "lynx", label v2-8-3dev_2
Diffstat (limited to 'WWW/Library/Implementation/HTAnchor.c')
-rw-r--r--WWW/Library/Implementation/HTAnchor.c21
1 files changed, 21 insertions, 0 deletions
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 <UCAux.h>
 #include <UCMap.h>
 
+#include <LYUtils.h>
 #include <LYCharSets.h>
 #include <LYLeaks.h>
 
@@ -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) {