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 NullReferenceException on subsequent runs #485

Closed

Conversation

arthurkehrwald
Copy link
Contributor

Fixes #472 by initializing the physics engine's event queue in the Awake function instead of using a field initializer.

@arthurkehrwald
Copy link
Contributor Author

I realized that using Awake is not safe because the queue may be accessed before that runs, so I switched to lazy initialization instead and added a comment to explain why the resulting verbose code is necessary.

@arthurkehrwald
Copy link
Contributor Author

This fix is included in #486

@freezy freezy deleted the fix-null-exception branch November 8, 2024 14:37
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.

NullReferenceException on subsequent runs
1 participant