stride icon indicating copy to clipboard operation
stride copied to clipboard

Fix crash on exit for fullscreen

Open Doprez opened this issue 1 year ago • 2 comments

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.

Doprez avatar May 17 '24 15:05 Doprez

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 ?

Eideren avatar May 18 '24 16:05 Eideren

I can remove it but it still happens from your original comment due to the IsFullScreen caught and ignored error. image

Doprez avatar May 18 '24 17:05 Doprez

@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

Doprez avatar May 25 '24 02:05 Doprez