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

Close custom substate on destroy #15572

Open
wants to merge 8 commits into
base: experimental
Choose a base branch
from

Conversation

LarryFrosty
Copy link
Contributor

@LarryFrosty LarryFrosty commented Sep 23, 2024

Close the custom substate manually on destroy to prevent a crash that happens if the state gets reset or changed while the substate is still active

This PR also makes it so that CustomSubstate.instance is no longer set to null when closeCustomSubstate is called, and is instead set to null when destroy is called

Anyways, the reason that the custom substate crashes is most likely due to the substate being closed by Flixel itself, WAY after PlayState has already been destroyed
And thus, the game is trying to call PlayState.instance.callOnScripts while the instance variable has already been set to null

should prevent crashing if the state was changed or reset while the substate is still active
@LarryFrosty LarryFrosty changed the title Close custom substate on destroy Close the substate on destroy Sep 23, 2024
@LarryFrosty LarryFrosty changed the title Close the substate on destroy Close substates on destroy Sep 23, 2024
@LarryFrosty LarryFrosty changed the title Close substates on destroy Close custom substate on destroy Sep 23, 2024
@LarryFrosty
Copy link
Contributor Author

Why did linux fail

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

Successfully merging this pull request may close these issues.

1 participant