What code-base are you using (0.9.21b / the 2_3_2 branch from git)? Can you
provide stack-trace, or specific crash message?

Try perhaps _tcsdup'ing wseq_string?

Itamar.

> -----Original Message-----
> From: Norman Barker [mailto:norman.bar...@gmail.com] 
> Sent: Friday, June 11, 2010 10:50 PM
> To: clucene-developers@lists.sourceforge.net
> Subject: [CLucene-dev] document destructor causes crash
> 
> Hi,
> 
> I have a function
> 
> void CouchLuceneUpdater::write_doc(const char* target, Document* doc,
> Analyzer* an, bool append)
> {
>       // open in append mode
>       IndexWriter *writer = _CLNEW IndexWriter(target , an, append);
> 
>       writer->addDocument(doc); // works fine if I comment 
> this line out!
>       writer->flush();
>       writer->optimize();
>       writer->close();
>       _CLDELETE(writer);
> }
> 
> where  if I have the addDocument enabled then sooner or later 
> I get an error (the executable crashes) in the document destructor
> 
>       Document::~Document(){
>     //Func - Destructor
>       //Pre  - true
>       //Post - Instance has been destroyed
>     boost = 1.0f;
>     _CLDELETE(_fields);
>       }
> 
> when it tries to delete the fields
> 
> I create the document and call the function as
> 
>       Document config;
>       
>       config.add(*_CLNEW Field(_T(SEQ_NUM_FIELD),
>                       wseq_string,
>                       Field::STORE_YES | Field::INDEX_TOKENIZED));
> 
>       write_doc(target, &config, &an, true);
> 
> 
> have I done something obviously wrong?
> 
> thanks,
> 
> Norman
> 
> --------------------------------------------------------------
> ----------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate 
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky 
> parental unit.  See the prize list and enter to win: 
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> CLucene-developers mailing list
> CLucene-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/clucene-developers
> 



------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers

Reply via email to