8000 fix: initialize transitions only once by arseny034 · Pull Request #7 · fsmoothy/fsmoothy · GitHub
[go: up one dir, main page]

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: initialize transitions only once #7

Merged

Conversation

arseny034
Copy link
Contributor

Problem

The initializeStateMachine() function is called many times (on every after-load and after-insert entity event), therefore onExit hooks are wrapped more than once. This leads to the accumulation of function nesting, as each time onExit is nested into a new onExit. This eventually results in a stack overflow.

Solution

I'd suggest to mutate transitions only once in the state machine constructor.

@bondiano bondiano merged commit a0bdee7 into fsmoothy:master Jul 24, 2024
1 of 3 checks passed
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.

2 participants
0