aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-08-11 17:42:31 +0200
committerSimon Zeni <simon@bl4ckb0ne.ca>2021-09-06 14:21:23 -0400
commit0978a702d7eda51acd340b53984d844f17a45e39 (patch)
treee062a18b052218a42d64217e20f1960fe1896f9e
parent0fe3b453617e9329257eebc237d8661b673aca3b (diff)
surface: ensure buffer is reset to NULL in surface_state_move
When surface_state_move processes a NULL commit, make sure to reset state->buffer to NULL instead of leaving behind an old wlr_buffer.
-rw-r--r--types/wlr_surface.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/types/wlr_surface.c b/types/wlr_surface.c
index 2058e21a..f8c1dbd5 100644
--- a/types/wlr_surface.c
+++ b/types/wlr_surface.c
@@ -284,8 +284,9 @@ static void surface_state_move(struct wlr_surface_state *state,
surface_state_set_buffer(state, next->buffer_resource);
surface_state_reset_buffer(next);
+ wlr_buffer_unlock(state->buffer);
+ state->buffer = NULL;
if (next->buffer) {
- wlr_buffer_unlock(state->buffer);
state->buffer = wlr_buffer_lock(next->buffer);
}
wlr_buffer_unlock(next->buffer);