Re: Deleting anchors

Jim_Ravan@avid.com wrote:
> 
> I must have a misconception about anchors. I have one "read something"
> routine and one "write something" routine. Each of them creates one anchor.
> The reader creates an anchor to reqpresent the desination, and the writer
> creates a tmpAnchor to represent the source buffer. Both routines attempt
> to delete the anchors when they exit. This turns out to be a bad idea,
> because the next time libwww does *anything* with anchors, it crashes. When
> should I delete anchors? I'm really just trying to be a good memory citizen
> and not create memory leaks. Programmers get very nervous when they see
> code create an object and then find that the routine exits before deleting
> it.

Anchors are kind of tricky as they are referenced from a lot of places.
Essentially, they represent the part of the Web that the user has been
in touch with. Currently, there is no reference count on anchors so they
are very hard to delete on an individual basis. It is safe, however, to
delete them all if that is possible.

It would also be very nice if anchors in fact could serialized to disk -
that way an application can pick them up later on. It is very similar to
the persistent cache

	http://www.w3.org/Library/src/WWWCache.html

but anchors furthermore contain the link relations - the persistent
cache doesn't. I am looking for volunteers for helping on this - I don't
have time to work on this for the moment.

Henrik

Received on Thursday, 17 December 1998 15:51:07 UTC