[bug] fix game thread block by set wrong _loopTimeOut (#12724)

* [bug] fix game thread block by set wrong _loopTimeOut
This commit is contained in:
bofeng-song
2022-09-08 18:23:05 +08:00
committed by GitHub
parent 6ef5179b4a
commit 526e41bfa8
@@ -517,9 +517,8 @@ int AndroidPlatform::init() {
_loopTimeOut = LOW_FREQUENCY_TIME_INTERVAL;
_isLowFrequencyLoopEnabled = true;
IXRInterface *xr = getInterface<IXRInterface>();
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;
}