diff options
| author | Isaac Freund <mail@isaacfreund.com> | 2024-01-05 12:50:36 -0600 |
|---|---|---|
| committer | Isaac Freund <mail@isaacfreund.com> | 2024-01-05 12:50:36 -0600 |
| commit | 9aa0f1a9a686e792d63f52e6dff8e13f33284e61 (patch) | |
| tree | a9012fff0f91aa331636d48f820439d12839b81e | |
| parent | 393bfb42b98948f4864daab5187e270166ae8fba (diff) | |
| download | river-9aa0f1a9a686e792d63f52e6dff8e13f33284e61.tar.gz river-9aa0f1a9a686e792d63f52e6dff8e13f33284e61.tar.xz | |
Output: fix possible crash on destroy
| -rw-r--r-- | river/Root.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/river/Root.zig b/river/Root.zig index 0608287..8831203 100644 --- a/river/Root.zig +++ b/river/Root.zig @@ -856,7 +856,8 @@ fn handleSetGamma( _: *wl.Listener(*wlr.GammaControlManagerV1.event.SetGamma), event: *wlr.GammaControlManagerV1.event.SetGamma, ) void { - const output: *Output = @ptrFromInt(event.output.data); + // The output may have been destroyed, in which case there is nothing to do + const output = @as(?*Output, @ptrFromInt(event.output.data)) orelse return; std.log.debug("client requested to set gamma", .{}); |
