From 526e41bfa873efe1b18e1a9cfaf2432cf788f48d Mon Sep 17 00:00:00 2001 From: bofeng-song Date: Thu, 8 Sep 2022 18:23:05 +0800 Subject: [PATCH] [bug] fix game thread block by set wrong _loopTimeOut (#12724) * [bug] fix game thread block by set wrong _loopTimeOut --- native/cocos/platform/android/AndroidPlatform.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/native/cocos/platform/android/AndroidPlatform.cpp b/native/cocos/platform/android/AndroidPlatform.cpp index 5924866986..e6c43d5c81 100644 --- a/native/cocos/platform/android/AndroidPlatform.cpp +++ b/native/cocos/platform/android/AndroidPlatform.cpp @@ -517,9 +517,8 @@ int AndroidPlatform::init() { _loopTimeOut = LOW_FREQUENCY_TIME_INTERVAL; _isLowFrequencyLoopEnabled = true; IXRInterface *xr = getInterface(); - bool isXRInstanceCreated = xr && xr->getXRConfig(xr::XRConfigKey::INSTANCE_CREATED).getBool(); - if (!isXRInstanceCreated) { - // xr will not sleep, -1 we will block forever waiting for events. + if (xr && !xr->getXRConfig(xr::XRConfigKey::INSTANCE_CREATED).getBool()) { + // xr will sleep, -1 we will block forever waiting for events. _loopTimeOut = -1; _isLowFrequencyLoopEnabled = false; }