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.
This commit is contained in:
Amith Yamasani 2009-08-03 12:56:35 -07:00
parent cc7c8ea432
commit af580087de

View file

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