From 9002657bcca1d4f69e2ebd0447d4129fdb950245 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 28 Jan 2024 00:41:54 +0000 Subject: [PATCH] monitor: don't call output_state_finish on buffer-less state clears ref #4546 --- src/helpers/Monitor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 6dfd0a65..11f37704 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -684,7 +684,11 @@ void CMonitor::updateMatrix() { } void CMonitor::clearState() { - wlr_output_state_finish(&outputState); + if (outputState.buffer) + wlr_output_state_finish(&outputState); + else // free(gamma_lut) should be unnecessary as it shouldn't be non-null for buffer-less commits? + pixman_region32_fini(&outputState.damage); + outputState = {0}; wlr_output_state_init(&outputState); }