Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Bug #23908 - Crash on resize with SDL2.
SDL2 uses shared memory to communicate with the graphics system when using a software renderer. A resize event will cause SDL2 to invalidate the SDL_surface that relies on shared memory and any subsequent calls to will be SDL_GetWindowSurface will cause the shared memory do be unmapped as the old surface is released. This is problematic when it occurs during a rendering cycle, because the software rendered may also invoke SDL_GetWindowSurface, making any references to that surface that the game contains become stale. This will in turn cause a segmentation fault during blitting.
- Loading branch information
Showing
7 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
449aed0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand this and the previous commit correctly, this is working around the unusual way in which Wesnoth updates the window surface and handles/process events. At a high level I think I understand the intention here, even though I probably don't have a full appreciation for all the effort that went into reaching this point.
I'll test this on returning from work. Thanks for getting this far!
449aed0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. You will probably encounter https://gna.org/bugs/index.php?23934 when you test, but it should not be crashing any longer.