Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Leaving GameCore currently leaves static strong references to the custom beatmap, player settings, movement provider and BPM controller alive until later gameplay replaces them. The callback controller pointer also survives the outgoing scene.
This draft clears those references after the matching GameCore unload. Scene handles distinguish gameplay from additive environments; Unity's unload callback runs first, and a replacement GameCore loaded during that callback is protected. It does not manually free shared track/point-definition contexts or change the public interop API.
Validation: both included host tests pass across 100 transition/cleanup cycles, including additive/duplicate unloads, reentrant replacement, idempotence and omitted-root negative controls. Cleanup bodies run against host stand-ins rather than IL2CPP.
The equivalent logic was observed in an experimental local Beat Saber 1.45.1 build on Quest 3: three bounded map runs (about eight advancing song seconds each) returned to the menu and logged release of all three base-provider roots without an observed exception. The upstream-supported 1.40.8 version has not been device-tested with this patch. An NDK r27c syntax-only attempt stopped in the existing beatsaber-hook dependency's missing
std::spandeclarations; the unmodified upstream files fail at the same point. No upstream build pass is claimed. Full songs and broad compatibility remain unverified. This source-only draft requests maintainer review, not adoption or 1.45.1 support.Prepared with AI assistance.