Browse Source

Replace ALooper_pollAll with ALooper_pollOnce (#3334)

Sandy 1 year ago
parent
commit
409fbc5d14
1 changed files with 3 additions and 2 deletions
  1. 3 2
      examples/common/entry/entry_android.cpp

+ 3 - 2
examples/common/entry/entry_android.cpp

@@ -189,9 +189,10 @@ namespace entry
 
 
 			while (0 == m_app->destroyRequested)
 			while (0 == m_app->destroyRequested)
 			{
 			{
-				int32_t num;
 				android_poll_source* source;
 				android_poll_source* source;
-				/*int32_t id =*/ ALooper_pollAll(-1, NULL, &num, (void**)&source);
+				int32_t result = ALooper_pollOnce(-1, NULL, NULL, reinterpret_cast<void**>(&source));
+
+				BX_ASSERT(ALOOPER_POLL_ERROR != result, "ALooper_pollOnce returned an error.");
 
 
 				if (NULL != source)
 				if (NULL != source)
 				{
 				{