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

Fix GameHost.Collect() being called twice on android #6272

Merged
merged 4 commits into from
May 28, 2024

Conversation

Susko3
Copy link
Member

@Susko3 Susko3 commented Apr 30, 2024

Depends on (to have identical behaviour):

SDL sends us a SDL_EVENT_LOW_MEMORY when Android's onLowMemory() handler fires. o!f handles this event and calls GameHost.Collect(). We also have our own handling in onTrimMemory(). Depending on how android handles those two functions, we may collect memory twice.

I think it makes more sense to just have SDL_EVENT_LOW_MEMORY handling, and not have custom logic just for android.

This PR was originally meant to pick out the useful parts from https://github.com/ppy/osu-framework/pull/6269/files#r1584189904, but I've since realised SDL already sends us a low memory event that we handle.

@hwsmm
Copy link
Contributor

hwsmm commented Apr 30, 2024

I actually noticed it before, so I removed it in my cleanup commit, but I guess some changes after mine added it back?

Though I think I should have added a comment in the commit to make sure it was intended.

@peppy
Copy link
Sponsor Member

peppy commented May 24, 2024

i guess we have a new sdl3-cs build now?

@bdach
Copy link
Collaborator

bdach commented May 24, 2024

Probably be best to get another sdl3-cs package out to get the fix for #6299.

@Susko3 Susko3 force-pushed the fix-gamehost-collect-on-android branch from a724243 to 2c7704b Compare May 24, 2024 21:10
@Susko3
Copy link
Member Author

Susko3 commented May 24, 2024

I've bumped ppy.SDL3-CS.Android version to match ppy.SDL3-CS (they should always match, but it was missed). This includes the SDL3 change required for this PR.

Perhaps the ppy.SDL3-CS.Android package should depend on ppy.SDL3-CS of the same version. Bumping only one would cause package upgrade/downgrade build failures.

@smoogipoo smoogipoo merged commit f08f590 into ppy:master May 28, 2024
19 of 21 checks passed
@Susko3 Susko3 deleted the fix-gamehost-collect-on-android branch May 28, 2024 14:03
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

5 participants