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 2132 - Tests may use invalid SDL_window pointers when windows are closed
Summary: Tests may use invalid SDL_window pointers when windows are closed
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-03 21:02 UTC by norfanin
Modified: 2013-10-06 02:09 UTC (History)
0 users

See Also:


Attachments
Mark destroyed windows with NULL and check for it in the tests. (5.20 KB, patch)
2013-10-03 21:02 UTC, norfanin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description norfanin 2013-10-03 21:02:05 UTC
Created attachment 1355 [details]
Mark destroyed windows with NULL and check for it in the tests.

Some of the tests keep using the pointers of a destroyed SDL_Window when the common event handling handled the close event. The event handler itself does not NULL the pointer after the destruction.

The attached patch adds a loop in the handler that will assign NULL to the destroyed window. It also adds checks to some of the tests so they skip those windows by checking for NULL.
Comment 1 Sam Lantinga 2013-10-06 02:09:31 UTC
Looks good, thanks!
http://hg.libsdl.org/SDL/rev/e6f3e8fc96ea