Android joystick event handling: Don't blow up java ref counting by forgetting ReleaseElements.

Also, use JNI_ABORT to avoid writing back changes (we don't make any).
This commit is contained in:
Henrik Rydgård 2024-12-15 22:42:03 +01:00
parent 3b3b8fe2c1
commit afbf430899
2 changed files with 3 additions and 1 deletions

View file

@ -170,7 +170,7 @@ bool TextDrawerAndroid::DrawStringBitmap(std::vector<uint8_t> &bitmapData, TextS
} else {
_assert_msg_(false, "Bad TextDrawer format");
}
env->ReleaseIntArrayElements(imageData, jimage, 0);
env->ReleaseIntArrayElements(imageData, jimage, JNI_ABORT);
env->DeleteLocalRef(imageData);
return true;
}

View file

@ -1290,6 +1290,8 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_joystickAxis(
}
NativeAxis(axis, count);
delete[] axis;
env->ReleaseIntArrayElements(axisIds, axisIdBuffer, JNI_ABORT); // ABORT just means we don't want changes copied back!
env->ReleaseFloatArrayElements(values, valueBuffer, JNI_ABORT); // ABORT just means we don't want changes copied back!
}
extern "C" jboolean Java_org_ppsspp_ppsspp_NativeApp_mouseWheelEvent(