Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

原生平台的安全区域可能会导致黑屏的问题 #367

Open
zhitaocai opened this issue Apr 6, 2022 · 2 comments
Open

原生平台的安全区域可能会导致黑屏的问题 #367

zhitaocai opened this issue Apr 6, 2022 · 2 comments

Comments

@zhitaocai
Copy link

zhitaocai commented Apr 6, 2022

this.updateArea();

image

在原生平台上,this.updateArea() 里面会持有 this.node ,但是这里的监听中,却是延迟了 200 ms 才调用 this.updateArea

这样子,如果应用旋转屏幕后,立即切换场景之类,那么 safearea 里面引用的 this.node 就会被销毁并变成 null,在 200ms 之后调用了 updateArea ,此时就会导致一直闪屏/黑屏等问题

image

问题根源在于为什么需要 setTimeout 200 ms 呢?

@jareguo
Copy link
Contributor

jareguo commented Apr 6, 2022

我们这边是在后台回来前台后,检查离开时长,如果离开很久的话,需要用户重连游戏,在这个操作过程中
我们是会让用户切换到登录场景,然后就会触发了这个诡异的闪屏

@PPpro
Copy link
Contributor

PPpro commented Apr 6, 2022

this.node 这里确实需要做一下判空处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants