From 3a69f1f15192ae2a2815864f01788376695806c4 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 2 Jan 2013 18:46:51 +0100 Subject: [PATCH] (Android) Some more checks in input code --- android/native/jni/input_android.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/android/native/jni/input_android.c b/android/native/jni/input_android.c index 9307ac19aa..a2b30e48f8 100644 --- a/android/native/jni/input_android.c +++ b/android/native/jni/input_android.c @@ -96,10 +96,11 @@ static void android_input_poll(void *data) g_extern.lifecycle_state &= ~((1ULL << RARCH_RESET) | (1ULL << RARCH_REWIND) | (1ULL << RARCH_FAST_FORWARD_KEY) | (1ULL << RARCH_FAST_FORWARD_HOLD_KEY) | (1ULL << RARCH_MUTE) | (1ULL << RARCH_SAVE_STATE_KEY) | (1ULL << RARCH_LOAD_STATE_KEY) | (1ULL << RARCH_STATE_SLOT_PLUS) | (1ULL << RARCH_STATE_SLOT_MINUS)); // Read all pending events. - while(AInputQueue_hasEvents(android_app->inputQueue)) + while(AInputQueue_hasEvents(android_app->inputQueue) > 0) { AInputEvent* event = NULL; - AInputQueue_getEvent(android_app->inputQueue, &event); + if (AInputQueue_getEvent(android_app->inputQueue, &event) < 0) + break; if (AInputQueue_preDispatchEvent(android_app->inputQueue, event)) continue;