mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
surface: don't unref the current buffer on failure
If wlr_buffer_create fails, keep the previous buffer.
This commit is contained in:
parent
96e8e9b098
commit
7fc58e704a
1 changed files with 1 additions and 3 deletions
|
@ -296,15 +296,13 @@ static void surface_apply_damage(struct wlr_surface *surface) {
|
|||
}
|
||||
}
|
||||
|
||||
wlr_buffer_unref(surface->buffer);
|
||||
surface->buffer = NULL;
|
||||
|
||||
struct wlr_buffer *buffer = wlr_buffer_create(surface->renderer, resource);
|
||||
if (buffer == NULL) {
|
||||
wlr_log(WLR_ERROR, "Failed to upload buffer");
|
||||
return;
|
||||
}
|
||||
|
||||
wlr_buffer_unref(surface->buffer);
|
||||
surface->buffer = buffer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue