DO NOT MERGE ( Already in master ): Fix a global reference leak. # 2026571

Fix incorrect usage of Release<>ArrayElements. Code was not releasing global
references. IME would have crashed in 50000 key presses.
main
Amith Yamasani 2009-08-03 12:56:35 -07:00
parent cc7c8ea432
commit af580087de
1 changed files with 2 additions and 2 deletions

View File

@ -100,9 +100,9 @@ static int latinime_BinaryDictionary_getSuggestions(
int count = dictionary->getSuggestions(inputCodes, arraySize, (unsigned short*) outputChars, frequencies, int count = dictionary->getSuggestions(inputCodes, arraySize, (unsigned short*) outputChars, frequencies,
maxWordLength, maxWords, maxAlternatives); maxWordLength, maxWords, maxAlternatives);
env->ReleaseIntArrayElements(frequencyArray, frequencies, JNI_COMMIT); env->ReleaseIntArrayElements(frequencyArray, frequencies, 0);
env->ReleaseIntArrayElements(inputArray, inputCodes, JNI_ABORT); env->ReleaseIntArrayElements(inputArray, inputCodes, JNI_ABORT);
env->ReleaseCharArrayElements(outputArray, outputChars, JNI_COMMIT); env->ReleaseCharArrayElements(outputArray, outputChars, 0);
return count; return count;
} }