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

Remove OpenFl KeyboardEvents in FlxKeyManager on destroy to avoid crashes #3299

Merged

Conversation

DetectiveBaldi
Copy link
Contributor

@DetectiveBaldi DetectiveBaldi commented Dec 1, 2024

Can be easily replicated by destroying an FlxKeyboard / FlxKeyManager.

@Geokureli
Copy link
Member

Geokureli commented Dec 1, 2024

I need an actual use case for why you would need to manually destroy a FlxKeyboard.

@DetectiveBaldi
Copy link
Contributor Author

DetectiveBaldi commented Dec 1, 2024

I need an actual use case for why you would need to manually destroy a FlxKeyboard.

i'm creating a keyboard manager for an options menu and am removing it from the input list and destroying it when exiting the state
also i'm not sure how a use case for manually destroying the object is relevant here, the destroy method is meant to clean up objects and references, yet here it clearly isn't

@Geokureli
Copy link
Member

I need an actual use case for why you would need to manually destroy a FlxKeyboard.

i'm creating a keyboard manager for an options menu and am removing it from the input list and destroying it when exiting the state also i'm not sure how a use case for manually destroying the object is relevant here, the destroy method is meant to clean up objects and references, yet here it clearly isn't

I don't see how it's not relevant, you're making this change because you're manually destroying FlxKeyManager, and you're apparently the first person to do ever do that and see undesired behavior. I always ask for a practical repo, because tons of PRs are from people who don't actually have a use for their change and not including an example is a red flag.

That said, I asked because I read this on my phone, I'm home now, looking through the code and yeah, this makes sense

@Geokureli Geokureli merged commit fedc206 into HaxeFlixel:dev Dec 2, 2024
11 checks passed
@Geokureli
Copy link
Member

Thanks!

@Geokureli Geokureli added this to the 5.9.0 milestone Dec 2, 2024
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.

2 participants