mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
concurrent excepton
This commit is contained in:
parent
ff5e3b5778
commit
f65d47602a
20
mdx.cc
20
mdx.cc
|
@ -911,14 +911,20 @@ void MdxDictionary::loadArticle( uint32_t offset, string & articleText, bool noF
|
|||
QString articleId;
|
||||
articleId.setNum( ( quint64 )pRecordInfo, 16 );
|
||||
|
||||
ScopedMemMap compressed( dictFile, recordInfo.compressedBlockPos, recordInfo.compressedBlockSize );
|
||||
if ( !compressed.startAddress() )
|
||||
throw exCorruptDictionary();
|
||||
|
||||
QByteArray decompressed;
|
||||
if ( !MdictParser::parseCompressedBlock( recordInfo.compressedBlockSize, ( char * )compressed.startAddress(),
|
||||
recordInfo.decompressedBlockSize, decompressed ) )
|
||||
throw exCorruptDictionary();
|
||||
|
||||
{
|
||||
Mutex::Lock _( idxMutex );
|
||||
ScopedMemMap compressed( dictFile, recordInfo.compressedBlockPos, recordInfo.compressedBlockSize );
|
||||
if( !compressed.startAddress() )
|
||||
throw exCorruptDictionary();
|
||||
|
||||
if( !MdictParser::parseCompressedBlock( recordInfo.compressedBlockSize,
|
||||
(char *)compressed.startAddress(),
|
||||
recordInfo.decompressedBlockSize,
|
||||
decompressed ) )
|
||||
throw exCorruptDictionary();
|
||||
}
|
||||
|
||||
QString article = MdictParser::toUtf16( encoding.c_str(),
|
||||
decompressed.constData() + recordInfo.recordOffset,
|
||||
|
|
Loading…
Reference in a new issue