From 0654c7025fbe241efddf0c3b9e58817f262aeda9 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Thu, 3 Dec 1998 18:41:23 -0500 Subject: snapshot of project "lynx", label v2-8-2dev_8 --- WWW/Library/Implementation/HTAnchor.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'WWW/Library/Implementation/HTAnchor.c') diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c index a141213c..3e0c4375 100644 --- a/WWW/Library/Implementation/HTAnchor.c +++ b/WWW/Library/Implementation/HTAnchor.c @@ -302,6 +302,7 @@ PRIVATE void free_adult_table NOARGS adult_table[i_counter] = HTAp_freeme->next; if (HTAp_freeme->object) { parent = (HTParentAnchor *)HTAp_freeme->object; + parent->underway = FALSE; HTAnchor_delete(parent); } FREE(HTAp_freeme); @@ -446,6 +447,14 @@ PRIVATE void deleteLinks ARGS1( if (me->mainLink.dest) { HTParentAnchor *parent = me->mainLink.dest->parent; + /* + * Set the mainLink pointer to zero NOW. If we don't, + * and we get somehow called recursively again for this + * same old me during the HTAnchor_delete below, weird + * things can occasionally happen. - kw + */ + me->mainLink.dest = NULL; + /* * Remove me from the parent's sources so that the * parent knows one less anchor is it's dest. @@ -478,7 +487,6 @@ PRIVATE void deleteLinks ARGS1( * Leave the HTAtom pointed to by type up to other code to * handle (reusable, near static). */ - me->mainLink.dest = NULL; me->mainLink.type = NULL; } @@ -570,6 +578,12 @@ PUBLIC BOOL HTAnchor_delete ARGS1( return(NO); } + /* + * Mark ourselves busy, so that recursive calls of this function + * on this HTParentAnchor will not free it from under our feet. - kw + */ + me->underway = TRUE; + /* * Recursively try to delete destination anchors of this parent. * In any event, this will tell all destination anchors that we @@ -596,6 +610,7 @@ PUBLIC BOOL HTAnchor_delete ARGS1( } } } + me->underway = FALSE; /* * Can't delete parent, still have sources. @@ -619,6 +634,7 @@ PUBLIC BOOL HTAnchor_delete ARGS1( } } } + me->underway = FALSE; /* * Delete our empty list of children. -- cgit 1.4.1-2-gfad0