Fix leak on error

Destroy video buffer if screen window creation failed.
This commit is contained in:
Romain Vimont 2021-05-16 15:54:02 +02:00
parent 83116fc199
commit f19c455110

View file

@ -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;
}