소스 검색

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
rem..om 12 년 전
부모
커밋
9e3a98931a
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      engine/src/android/com/jme3/input/android/AndroidInput.java

+ 5 - 1
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);
+            }
+            
         }
     }