mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 17:24:08 +00:00
concurrent excepton
This commit is contained in:
parent
ff5e3b5778
commit
f65d47602a
14
mdx.cc
14
mdx.cc
|
@ -911,14 +911,20 @@ void MdxDictionary::loadArticle( uint32_t offset, string & articleText, bool noF
|
|||
QString articleId;
|
||||
articleId.setNum( ( quint64 )pRecordInfo, 16 );
|
||||
|
||||
QByteArray decompressed;
|
||||
|
||||
{
|
||||
Mutex::Lock _( idxMutex );
|
||||
ScopedMemMap compressed( dictFile, recordInfo.compressedBlockPos, recordInfo.compressedBlockSize );
|
||||
if ( !compressed.startAddress() )
|
||||
if( !compressed.startAddress() )
|
||||
throw exCorruptDictionary();
|
||||
|
||||
QByteArray decompressed;
|
||||
if ( !MdictParser::parseCompressedBlock( recordInfo.compressedBlockSize, ( char * )compressed.startAddress(),
|
||||
recordInfo.decompressedBlockSize, decompressed ) )
|
||||
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