don't crash in networked games

This commit is contained in:
Eric House 2014-03-10 18:58:16 -07:00
parent fec1ce3bed
commit 6203a23c62

View file

@ -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 );