We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0025f05 commit aa051dfCopy full SHA for aa051df
include/cleanup.h
@@ -22,18 +22,30 @@ void cleanup(T *t, Args&&... args){
22
*/
23
template<>
24
void cleanup<SDL_Window>(SDL_Window *win){
25
+ if (!win){
26
+ return;
27
+ }
28
SDL_DestroyWindow(win);
29
}
30
31
void cleanup<SDL_Renderer>(SDL_Renderer *ren){
32
+ if (!ren){
33
34
35
SDL_DestroyRenderer(ren);
36
37
38
void cleanup<SDL_Texture>(SDL_Texture *tex){
39
+ if (!tex){
40
41
42
SDL_DestroyTexture(tex);
43
44
45
void cleanup<SDL_Surface>(SDL_Surface *surf){
46
+ if (!surf){
47
48
49
SDL_FreeSurface(surf);
50
51
0 commit comments