Commit 6f9aebe
committed
Prevent resource leak in SDL backend
When twin_sdl_init() fails after successful SDL_Init() but before
completion (e.g., SDL_CreateWindow fails), the SDL subsystem is not
properly cleaned up, leaking system resources.
The bail chain was missing SDL_Quit() cleanup. Error paths jumped
directly to 'bail' label which only freed memory, leaving SDL
initialized.1 parent 62aaf7e commit 6f9aebe
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| 195 | + | |
| 196 | + | |
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
| |||
0 commit comments