-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/mobile: application freeze after resumed from suspend state on iOS #27483
Comments
I have made some experiments, in the 'darwin_ios.m' file, we can see the
If the App just resumed from the background, we can call But call
But in the current implementation, it use a custom for loop:
And in cocos2dx, they use the CADisplayLink's loop(Apple best practice). So, is there any special reasons to use custom loop, and is there any quick way to fix this bug? @eliasnaur @crawshaw |
Has anyone made progress on this? |
@andydotxyz You can see my fixes here: KorokEngine/mobile@744fe39 . I have test it on Mac/PC/Android/iOS, it works well. |
Oh you're a life saver. I hope you don't mind but I cherry-picked your fixes on top of the latest golang.org/x/mobile along with my own compile fixes - that's all at fyne-io/mobile, check it out if you like. |
Change https://golang.org/cl/350211 mentions this issue: |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.8.1 darwin/amd64
Does this issue reproduce with the latest release?
YES
What did you do?
Git clone the basic example, change the lifecycle code to:
In the original code, use
switch e.Crosses(lifecycle. StageVisible)
to manage lifecycle, but this code will result in create/destroy gl resource each time the application resume/pause. In practical app, we should usee.Crosses(lifecycle.StageAlive)
, but this will result in application freeze if app just resumed from suspend state in iOS. I have written a native iOS app with Obj-C/GLKView, but it doesn't have the problem, it must be a bug in gomobile .(PS: Android will just lost glContext, I have created another issue for Android).
What did you expect to see?
The example don't freeze after resumed from suspend state on iOS.
What did you see instead?
The example freezed.
The text was updated successfully, but these errors were encountered: