git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commitba02f0f7033d2e14baf21a7f22c6adb01a216888
parentdcb277751f
authorIsaac Freund <[email protected]>
date2025-12-04 22:24
Output: fix mode lifetime

Ensure we don't keep a pointer to an output mode owned by wlroots after
the wlr_output has been destroyed.

 river/Output.zig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/river/Output.zig b/river/Output.zig
index d453df8..a69c9a4 100644
--- a/river/Output.zig
+++ b/river/Output.zig
@@ -230,6 +230,9 @@ fn handleDestroy(listener: *wl.Listener(*wlr.Output), wlr_output: *wlr.Output) v
 
     output.wlr_output = null;
     output.scene_output = null;
+    output.scheduled.mode = .none;
+    output.sent.mode = .none;
+    output.current.mode = .none;
     output.scheduled.state = .destroying;
 
     server.wm.dirtyWindowing();