This is a scope issue - by the time you call writer->addDocument, the 
fields you added to it are freed. Use this code instead:

|       document->add(*  new  lucene::document::Field(fieldName,  fieldValue,  
true,  true,  true,  false));
|

You may want to look at cl_demo and cl_test to see some code samples.

Itamar.


On 1/7/2010 3:39 PM, theorist wrote:
> perhaps, this is a bug:
>
> http://stackoverflow.com/questions/3150563/
>
> environment:
>
> Kubuntu 10.04 64-bit
>
> g++-4.4 4.4.3-4ubuntu5 (amd64), libstdc++6 4.4.3-4ubuntu5 (amd64), 
> libstdc++6-4.4-dev 4.4.3-4ubuntu5 (amd64)
>
> libclucene-dev 0.9.21b-2 (amd64), libclucene0ldbl 0.9.21b-2 (amd64)
>
> libtag1-dev 1.6.3-0ubuntu1 (amd64), libtag-extras-dev 1.0.1-2 (amd64), 
> libtag1c2a 1.6.3-0ubuntu1 (amd64), libtag1-vanilla 1.6.3-0ubuntu1 (amd64), 
> libtag-extras1 1.0.1-2 (amd64)
>
> even when the application doesn't crash [no iteration] valgrind reports a 
> number of errors taking place before adding the document to the index [see 
> "no crash.txt"]
>
> and when it crashes [one iteration] valgrind reports additional errors [see 
> crash.txt"]
>
> shall i file the bug? or this is something different?
>    
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>
>
> _______________________________________________
> CLucene-developers mailing list
> CLucene-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/clucene-developers
>    

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers

Reply via email to