mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
don't crash in networked games
This commit is contained in:
parent
fec1ce3bed
commit
6203a23c62
1 changed files with 6 additions and 3 deletions
|
@ -63,8 +63,10 @@ DictionaryCtxt*
|
||||||
linux_dictionary_make( MPFORMAL const LaunchParams* params,
|
linux_dictionary_make( MPFORMAL const LaunchParams* params,
|
||||||
const char* dictFileName, XP_Bool useMMap )
|
const char* dictFileName, XP_Bool useMMap )
|
||||||
{
|
{
|
||||||
LinuxDictionaryCtxt* result =
|
LinuxDictionaryCtxt* result = NULL;
|
||||||
(LinuxDictionaryCtxt*)dmgr_get( params->dictMgr, dictFileName );
|
if ( !!dictFileName ) {
|
||||||
|
result = (LinuxDictionaryCtxt*)dmgr_get( params->dictMgr, dictFileName );
|
||||||
|
}
|
||||||
if ( !result ) {
|
if ( !result ) {
|
||||||
result = (LinuxDictionaryCtxt*)XP_CALLOC(mpool, sizeof(*result));
|
result = (LinuxDictionaryCtxt*)XP_CALLOC(mpool, sizeof(*result));
|
||||||
|
|
||||||
|
@ -84,8 +86,9 @@ linux_dictionary_make( MPFORMAL const LaunchParams* params,
|
||||||
XP_FREE( mpool, result );
|
XP_FREE( mpool, result );
|
||||||
result = NULL;
|
result = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dmgr_put( params->dictMgr, dictFileName, &result->super );
|
||||||
}
|
}
|
||||||
dmgr_put( params->dictMgr, dictFileName, &result->super );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return dict_ref( &result->super );
|
return dict_ref( &result->super );
|
||||||
|
|
Loading…
Reference in a new issue