mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-12-18 03:14:06 +00:00
Fix some crashes
This commit is contained in:
parent
361a9ceb97
commit
df94e2ee80
1
bgl.cc
1
bgl.cc
|
@ -417,6 +417,7 @@ namespace
|
||||||
dictionaryDescription = "NONE";
|
dictionaryDescription = "NONE";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Mutex::Lock _( idxMutex );
|
||||||
vector< char > chunk;
|
vector< char > chunk;
|
||||||
char * dictDescription = chunks.getBlock( idxHeader.descriptionAddress, chunk );
|
char * dictDescription = chunks.getBlock( idxHeader.descriptionAddress, chunk );
|
||||||
string str( dictDescription );
|
string str( dictDescription );
|
||||||
|
|
|
@ -491,7 +491,11 @@ void DictdDictionary::getArticleText( uint32_t articleAddress, QString & headwor
|
||||||
|
|
||||||
string articleText;
|
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 )
|
if ( !articleBody )
|
||||||
{
|
{
|
||||||
|
|
1
mdx.cc
1
mdx.cc
|
@ -886,6 +886,7 @@ const QString & MdxDictionary::getDescription()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Mutex::Lock _( idxMutex );
|
||||||
vector< char > chunk;
|
vector< char > chunk;
|
||||||
char * dictDescription = chunks.getBlock( idxHeader.descriptionAddress, chunk );
|
char * dictDescription = chunks.getBlock( idxHeader.descriptionAddress, chunk );
|
||||||
string str( dictDescription );
|
string str( dictDescription );
|
||||||
|
|
Loading…
Reference in a new issue