We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5084

Summary: [PATCH] NULL out pointer to freed window surface
Product: SDL Reporter: Jay Petacat <libsdl.org>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: All   
Attachments: Patch

Description Jay Petacat 2020-04-12 05:09:20 UTC
Created attachment 4300 [details]
Patch

This behavior matches SDL_RecreateWindow and makes it less likely that
another piece of code (e.g. a DestroyWindowFramebuffer implementation)
will attempt to use or free the stale surface pointer.
Comment 1 Sam Lantinga 2020-04-13 15:12:28 UTC
Good catch, thanks!
https://hg.libsdl.org/SDL/rev/458f2f2919ab