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

[3.x] Resolve issue where the Godot app remains stuck when resuming. #51584

Merged

Conversation

m4gr3d
Copy link
Contributor

@m4gr3d m4gr3d commented Aug 12, 2021

This was caused by the fact that a new instance of Godot was created at resume while a previous instance already existed.

The previous instance would then go through its cleanup lifecycle, and would thus attempt to close the entire app, leading to the system to restart the app, thus starting the cycle anew.

The fix involves reusing the previous instance of Godot if one is available instead of creating a new one, as well as giving control to the host activity for how the process should be terminated.

Fix #51021
Contributes to #31541

@mbrlabs
Copy link
Contributor

mbrlabs commented Aug 12, 2021

Nice, that explains the weird bahaviour. Thanks for the fix!

I tested it with my project via the "Don't keep activities" debug option and by opening a lot other other apps until i could see it getting killed by the system in the logs. Works great!

@Calinou
Copy link
Member

Calinou commented Aug 12, 2021

Is this fix also needed in master?

@m4gr3d
Copy link
Contributor Author

m4gr3d commented Aug 12, 2021

@mbrlabs Thanks!

Is this fix also needed in master?

Yes, I'm making a forward cherry-pick for master now that @mbrlabs has confirmed to be working!

@m4gr3d m4gr3d marked this pull request as ready for review August 12, 2021 19:36
@m4gr3d m4gr3d changed the title Resolve issue where the Godot app remains stuck when resuming. [3.x] Resolve issue where the Godot app remains stuck when resuming. Aug 12, 2021
@m4gr3d m4gr3d force-pushed the investigate_godot_resume_stalls_3_x branch from 4be6ef2 to 8f6fe5f Compare August 12, 2021 19:57
This was caused by the fact that a new instance of Godot was created at resume while a previous instance already existed.
The previous instance would then go through its cleanup lifecycle, and would thus attempt to close the entire app, leading to the system to restart the app, thus starting the cycle anew.
The fix involves reusing the previous instance of Godot if one is available instead of creating a new one, as well as giving control to the host activity for how the process should be terminated.
@m4gr3d m4gr3d force-pushed the investigate_godot_resume_stalls_3_x branch from 8f6fe5f to 874aa17 Compare August 13, 2021 03:58
@akien-mga akien-mga merged commit f976cec into godotengine:3.x Aug 13, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.3.3.

@m4gr3d m4gr3d deleted the investigate_godot_resume_stalls_3_x branch August 13, 2021 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants