ui: Delete local variables asap on Android

This commit is contained in:
Hajime Hoshi 2017-11-13 01:30:08 +09:00
parent 88c84dc5ac
commit 362f002d36

View File

@ -44,6 +44,13 @@ static float deviceScale(uintptr_t java_vm, uintptr_t jni_env, uintptr_t ctx) {
(*env)->GetFloatField(
env, displayMetrics,
(*env)->GetFieldID(env, android_util_DisplayMetrics, "density", "F"));
(*env)->DeleteLocalRef(env, android_content_ContextWrapper);
(*env)->DeleteLocalRef(env, android_content_res_Resources);
(*env)->DeleteLocalRef(env, android_util_DisplayMetrics);
(*env)->DeleteLocalRef(env, resources);
(*env)->DeleteLocalRef(env, displayMetrics);
return density;
}