From 9e3a98931a2c2c3c8e050414fd4c6460c783fdf9 Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Mon, 25 Feb 2013 18:00:19 +0000 Subject: [PATCH] AndroidInput : Discarded new events when the eventQueue is full to avoid an overflow error. This should only append when more than 1024 events are generated before they've been transformd to JME input events. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10431 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/android/com/jme3/input/android/AndroidInput.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/src/android/com/jme3/input/android/AndroidInput.java b/engine/src/android/com/jme3/input/android/AndroidInput.java index 07468de49..73ca2d191 100644 --- a/engine/src/android/com/jme3/input/android/AndroidInput.java +++ b/engine/src/android/com/jme3/input/android/AndroidInput.java @@ -396,7 +396,11 @@ public class AndroidInput implements private void processEvent(TouchEvent event) { synchronized (eventQueue) { - eventQueue.push(event); + //Discarding events when the ring buffer is full to avoid buffer overflow. + if(eventQueue.size()< MAX_EVENTS){ + eventQueue.push(event); + } + } }