Fix leak on error
Destroy video buffer if screen window creation failed.
This commit is contained in:
parent
83116fc199
commit
f19c455110
1 changed files with 1 additions and 0 deletions
|
@ -344,6 +344,7 @@ screen_init(struct screen *screen, struct fps_counter *fps_counter,
|
|||
window_flags);
|
||||
if (!screen->window) {
|
||||
LOGC("Could not create window: %s", SDL_GetError());
|
||||
video_buffer_destroy(&screen->vb);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue