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

Crash when switching state while FlxInputText field is active #3242

Closed
DigiEggz opened this issue Aug 21, 2024 · 0 comments · Fixed by #3243
Closed

Crash when switching state while FlxInputText field is active #3242

DigiEggz opened this issue Aug 21, 2024 · 0 comments · Fixed by #3243

Comments

@DigiEggz
Copy link
Contributor

  • Haxe version: 4.3.4
  • Flixel version: 5.8.0+ (dev)
  • OpenFL version: 9.3.3
  • Lime version: 8.1.2
  • Affected targets: Desktop + Web

Switching to another FlxState while a FlxInputText field is active causes a FlxInputTextManager to remain active and continue dispatching events when switching back to the original state. The code location of the error varies depending on how it's triggered, but it causes the app to access a null textField.

I have included a test app to reproduce the issue: Demo.zip

Steps

  1. Run the app and click in the text field.
  2. Press the "S" key to change to the next state while the text field is still active.
  3. Press the "S" key to change back to the original state.
  4. Upon pressing the Up or Down keys, or even clicking in the field again, the game will crash with a "Null access" error.

If we force the field to lose focus when destroying it, this issue no longer occurs.

DigiEggz added a commit to DigiEggz/flixel that referenced this issue Aug 21, 2024
Prevents null textField access in FlxInputText when switching between states. Resolves HaxeFlixel#3242.
Geokureli pushed a commit that referenced this issue Aug 21, 2024
Prevents null textField access in FlxInputText when switching between states. Resolves #3242.
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 a pull request may close this issue.

1 participant