Subject: [htdig3-dev] StringList semantic change
From: Loic Dachary (loic@senga.org)
Date: Tue May 09 2000 - 09:40:49 PDT
Hi,
I've modified the semantic of StringList. At some point it was
modified to copy the pointer argument given. For instance:
StringList::Append(String* foo) {
List::Append(new String(*foo));
}
This would not be a problem if it was consistent with the List
semantic. Unfortunately it is not : List stores pointers without copying them.
I suspect that this change was made when someone hacked HtWordCodec
since it was the only class that took advantage of this particular semantic.
All other usage of StringList (~60, all reviewed) assume the List semantic.
This inconsistency caused memory leaks and was adressed in some places
but not all. I've checked every use of StringList and it's now clean and does
not leak.
Please remember that StringList contains pointers on objects that
will be destroyed when the StringList object is destroyed. If you don't
want StringList to delete the objects, call StringList::Release before
the object is deleted. This will empty the list and therefore preventing
their deletion.
I ran *all* the regression test thru purify to make sure those
modifications did not alter things in a hidden way. I also fixed a few minor
memory leaks.
Cheers,
-- Loic Dachary http://www.dachary.org/ loic@dachary.org 24 av Secretan http://www.senga.org/ loic@senga.org 75019 Paris Tel: 33 1 42 45 09 16 loic@gnu.org------------------------------------ To unsubscribe from the htdig3-dev mailing list, send a message to htdig3-dev-unsubscribe@htdig.org You will receive a message to confirm this.
This archive was generated by hypermail 2b28 : Tue May 09 2000 - 07:30:17 PDT