-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Extracted from #12676, #14502 (comment)
Currently, in the GDK implementation of SDL_RunApp(), if GDK_RegisterChangeNotifications() fails, XTaskQueueTerminate(), XTaskQueueCloseHandle() and XGameRuntimeUninitialize() never get called, and argv is never freed. It also appears that the GDK_RegisterChangeNotifications() implementation itself doesn't appear to always clean up resources correctly on failure. It would be good to fix these.
Additionally, the Microsoft docs for XblInitialize() state that it "should have a corresponding call to XblCleanup()", which is currently missing from the GDK SDL_RunApp() and should probably be added for good measure, since it's unclear what the effects of not calling it are.
There is also a !!! FIXME comment about leaking handles despite following the Microsoft docs exactly. But looking at the Microsoft docs for cleaning up a task queue it looks like the example passes a timeout of INFINITE (0xffffffff), while SDL currently passes 0, so perhaps changing that will fix the leak.