Fix leak on error
Destroy video buffer if screen window creation failed.
This commit is contained in:
@@ -344,6 +344,7 @@ screen_init(struct screen *screen, struct fps_counter *fps_counter,
|
|||||||
window_flags);
|
window_flags);
|
||||||
if (!screen->window) {
|
if (!screen->window) {
|
||||||
LOGC("Could not create window: %s", SDL_GetError());
|
LOGC("Could not create window: %s", SDL_GetError());
|
||||||
|
video_buffer_destroy(&screen->vb);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user