From: <ust...@us...> - 2009-07-08 10:10:11
|
Revision: 3019 http://clucene.svn.sourceforge.net/clucene/?rev=3019&view=rev Author: ustramooner Date: 2009-07-08 10:10:09 +0000 (Wed, 08 Jul 2009) Log Message: ----------- various mem fixes Modified Paths: -------------- branches/lucene2_3_2/src/core/CLucene/index/SegmentReader.cpp Modified: branches/lucene2_3_2/src/core/CLucene/index/SegmentReader.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/SegmentReader.cpp 2009-07-08 10:09:32 UTC (rev 3018) +++ branches/lucene2_3_2/src/core/CLucene/index/SegmentReader.cpp 2009-07-08 10:10:09 UTC (rev 3019) @@ -996,11 +996,11 @@ clone->initialize(si, readBufferSize, false, true); clone->cfsReader = cfsReader; clone->storeCFSReader = storeCFSReader; - clone->_fieldInfos = _fieldInfos; - clone->tis = tis; - clone->freqStream = freqStream; - clone->proxStream = proxStream; - clone->termVectorsReaderOrig = termVectorsReaderOrig; + clone->_fieldInfos = _fieldInfos; + clone->tis = tis; + clone->freqStream = freqStream; + clone->proxStream = proxStream; + clone->termVectorsReaderOrig = termVectorsReaderOrig; // we have to open a new FieldsReader, because it is not thread-safe // and can thus not be shared among multiple SegmentReaders @@ -1043,7 +1043,8 @@ const TCHAR* curField = _fieldInfos->fieldInfo(i)->name; Norm* norm = this->_norms.get(curField); norm->incRef(); - clone->_norms.put(curField, norm); + norm->_this = clone; //give the norm to the clone + clone->_norms.put(curField, norm); } } @@ -1054,6 +1055,7 @@ const TCHAR* field = it->first; Norm* norm = _norms[field]; norm->incRef(); + norm->_this = clone; //give the norm to the clone clone->_norms.put(field, norm); it++; } @@ -1086,17 +1088,16 @@ clone->decRef(); } ) - - //disown this memory - this->freqStream = NULL; - this->_fieldInfos = NULL; - this->fieldsReader = NULL; - this->tis = NULL; - this->deletedDocs = NULL; - this->ones = NULL; - this->termVectorsReaderOrig = NULL; + + //disown this memory + this->freqStream = NULL; + this->_fieldInfos = NULL; + this->fieldsReader = NULL; + this->tis = NULL; + this->deletedDocs = NULL; + this->ones = NULL; + this->termVectorsReaderOrig = NULL; this->cfsReader = NULL; - this->singleNormStream = NULL; this->fieldsReader = NULL; this->tis = NULL; this->freqStream = NULL; @@ -1104,6 +1105,7 @@ this->termVectorsReaderOrig = NULL; this->cfsReader = NULL; this->storeCFSReader = NULL; + this->singleNormStream = NULL; return clone; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |