| Summary: | SDL_Quit does not call VideoQuit when video was auto-initialized via SDL_CreateWindow | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Jay Petacat <libsdl.org> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus |
| Version: | HG 2.0 | Keywords: | target-2.0.14 |
| Hardware: | x86 | ||
| OS: | Other | ||
|
Description
Jay Petacat
2020-03-30 04:37:05 UTC
(In reply to Jay Petacat from comment #0) > When exiting testspriteminimal, my driver's VideoQuit function is not > executed, even if I call SDL_Quit in the test's quit function (is it > intentionally absent?). It is not intentionally absent, and I have now fixed that in https://hg.libsdl.org/SDL/rev/84dc2aca3b52 > My expectation is that SDL_Quit should know what to cleanup in this > situation. If a maintainer affirms this, I will attempt to develop a patch. You are correct, I think this is an oversight because most things call SDL_Init() explicitly (the attempt to recover by calling SDL_VideoInit implicitly is a leftover from SDL 1.2, and we should probably remove this behavior for SDL 2.1). > Tangentially, if omitting SDL_Quit is a supported scenario, how shall I > ensure my VideoQuit gets executed? atexit? It's not a supported scenario, it was just a mistake in testspriteminimal, I assume it was deleted when cutting down testsprite2.c to not use the test framework. Your diagnosis was correct, and I've now corrected the init call in https://hg.libsdl.org/SDL/rev/22ef6c87d061 Thanks! --ryan. |