Do a full cleanup if renderer creation fails during autodetection

This commit is contained in:
Sam Lantinga 2024-07-27 16:19:05 -07:00
parent ebd059e6eb
commit 95dd8781ce
10 changed files with 5 additions and 26 deletions

View file

@ -1029,6 +1029,7 @@ SDL_Renderer *SDL_CreateRendererWithProperties(SDL_PropertiesID props)
if (rc == 0) {
break; // Yay, we got one!
}
SDL_DestroyRendererWithoutFreeing(renderer);
SDL_zerop(renderer); // make sure we don't leave function pointers from a previous CreateRenderer() in this struct.
}
}