Fix crash on exit for fullscreen
PR Details
Recreate was being called even when the game was exiting, causing disposed references to be called.
Description
This adds a check on recreate if the game is exiting to skip the recreate function.
Related Issue
https://github.com/stride3d/stride/issues/2008
Motivation and Context
crash bad.
Types of changes
- [x] Docs change / refactoring / dependency upgrade
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
- [ ] My change requires a change to the documentation.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
- [x] I have built and run the editor to try this change out.
Does the workaround mentioned here https://github.com/stride3d/stride/issues/2008#issuecomment-2118869130 still make sense, it's probably best to remove or replace that workaround instead of adding another workaround because of that workaround ?
I can remove it but it still happens from your original comment due to the IsFullScreen caught and ignored error.
@Eideren I finally think I figured it out. This seems to work for both the issues of fullscreen toggle AND exiting when in fullscreen. You were right it had to do with the Window events.
Im going to close this and make a simpler PR since the solution was just to add an event for specifically disabling the fullscreen