Fix some crashes

This commit is contained in:
Abs62 2014-04-21 00:02:41 +04:00
parent 361a9ceb97
commit df94e2ee80
3 changed files with 7 additions and 1 deletions

1
bgl.cc
View file

@ -417,6 +417,7 @@ namespace
dictionaryDescription = "NONE";
else
{
Mutex::Lock _( idxMutex );
vector< char > chunk;
char * dictDescription = chunks.getBlock( idxHeader.descriptionAddress, chunk );
string str( dictDescription );

View file

@ -491,7 +491,11 @@ void DictdDictionary::getArticleText( uint32_t articleAddress, QString & headwor
string articleText;
char * articleBody = dict_data_read_( dz, articleOffset, articleSize, 0, 0 );
char * articleBody;
{
Mutex::Lock _( dzMutex );
articleBody = dict_data_read_( dz, articleOffset, articleSize, 0, 0 );
}
if ( !articleBody )
{

1
mdx.cc
View file

@ -886,6 +886,7 @@ const QString & MdxDictionary::getDescription()
}
else
{
Mutex::Lock _( idxMutex );
vector< char > chunk;
char * dictDescription = chunks.getBlock( idxHeader.descriptionAddress, chunk );
string str( dictDescription );