OK, I took a closer look at Dictionary.cc.  I had been confusing your
new word_entry objects with the DictionaryEntry ones.  It seems the
DictionaryEntry class handles the release() call, and shouldn't care
whether the object it points to has already been deleted or not.  So,
I think the way you're handling deletes and Release is indeed correct.

I'm at a loss to explain Joe's segfaults -- I can't reproduce the problem
here.

Earlier I wrote:
> I'm not quite sure about this myself either.  I've always been a bit
> confused about when Release vs Destroy is appropriate, and I'm not sure
> it's always used correctly in the code.  My understanding is that Release
> is to be used when the individual entries in the table are still supposed
> to stick around, e.g. if they're shared with something else.
> 
> In the case of your patch, it doesn't seem quite right to me, because
> you delete individual entries before doing a Release() on the whole
> dictionary.  But the Release() calls release() on each entry, which it
> seems has already been deleted.  Or, is there some intermediate object,
> other than the word_entry, which handles the release() call?  It seems
> you could just do a Destroy() call at the end, and not do the deletes, and
> that would be safest, but it might mean consuming more RAM in the interim.
> 
> According to Lachlan Andrew:
> > By the way, that patch was relative to Gilles's recent patch.
> > 
> > Also, I'm not quite sure if I'm cleaning up the Dictionary correctly.  
> > Could someone check that?
> > 
> > Thanks,
> > Lachlan
> > 
> > On Sat, 24 Apr 2004 01:19 pm, Lachlan Andrew wrote:
> > > 5. For those who want 3.1.6 functionality with minimal overhead,
> > >    I suggest the attached patch, which adds a "store_phrases"
> > >    attribute.  If that is false, the DB size is cut to 1/3 by
> > >    storing only the first occurrence of each word in the text of
> > >    a document.  (Keywords, links etc can still have reduncancy.)
> 
> 
> -- 
> Gilles R. Detillieux              E-mail: <[EMAIL PROTECTED]>
> Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/
> Dept. Physiology, U. of Manitoba  Winnipeg, MB  R3E 3J7  (Canada)
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
> For a limited time only, get FREE Ground shipping on all orders of $35
> or more. Hurry up and shop folks, this offer expires April 30th!
> http://www.thinkgeek.com/freeshipping/?cpg=12297
> _______________________________________________
> ht://Dig Developer mailing list:
> [EMAIL PROTECTED]
> List information (subscribe/unsubscribe, etc.)
> https://lists.sourceforge.net/lists/listinfo/htdig-dev
> 


-- 
Gilles R. Detillieux              E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/
Dept. Physiology, U. of Manitoba  Winnipeg, MB  R3E 3J7  (Canada)


-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
ht://Dig Developer mailing list:
[EMAIL PROTECTED]
List information (subscribe/unsubscribe, etc.)
https://lists.sourceforge.net/lists/listinfo/htdig-dev

Reply via email to