mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
don't ref dicts from dmgr_get()
This commit is contained in:
parent
a4302897e2
commit
dee75f5a0a
1 changed files with 3 additions and 2 deletions
|
@ -613,6 +613,7 @@ makeDict( MPFORMAL JNIEnv *env, DictMgrCtxt* dictMgr, JNIUtilCtxt* jniutil, jstr
|
||||||
off_t bytesSize = 0;
|
off_t bytesSize = 0;
|
||||||
|
|
||||||
const char* name = (*env)->GetStringUTFChars( env, jname, NULL );
|
const char* name = (*env)->GetStringUTFChars( env, jname, NULL );
|
||||||
|
/* remember: dmgr_get calls dict_ref() */
|
||||||
AndDictionaryCtxt* anddict = (AndDictionaryCtxt*)dmgr_get( dictMgr, name );
|
AndDictionaryCtxt* anddict = (AndDictionaryCtxt*)dmgr_get( dictMgr, name );
|
||||||
|
|
||||||
if ( NULL == anddict ) {
|
if ( NULL == anddict ) {
|
||||||
|
@ -665,12 +666,12 @@ makeDict( MPFORMAL JNIEnv *env, DictMgrCtxt* dictMgr, JNIUtilCtxt* jniutil, jstr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dmgr_put( dictMgr, name, &anddict->super );
|
dmgr_put( dictMgr, name, &anddict->super );
|
||||||
|
dict_ref( &anddict->super );
|
||||||
}
|
}
|
||||||
|
|
||||||
(*env)->ReleaseStringUTFChars( env, jname, name );
|
(*env)->ReleaseStringUTFChars( env, jname, name );
|
||||||
|
|
||||||
DictionaryCtxt* result = dict_ref( (DictionaryCtxt*)anddict ); /* NULL ok */
|
return &anddict->super;
|
||||||
return result;
|
|
||||||
} /* makeDict */
|
} /* makeDict */
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
Loading…
Add table
Reference in a new issue