From a6fc3e0e2e78aeb4219ce4ef6b866cc06b1b0e09 Mon Sep 17 00:00:00 2001 From: Omkar Chandorkar Date: Sat, 8 Aug 2026 15:22:23 +0530 Subject: [PATCH] gtk/wayland: clean up blur regions Destroy temporary Wayland regions after each blur update and release the previous cached blur region before replacing it. This prevents resources from leaking while the blur region changes. --- src/apprt/gtk/winproto/wayland.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apprt/gtk/winproto/wayland.zig b/src/apprt/gtk/winproto/wayland.zig index c65429699..81481514e 100644 --- a/src/apprt/gtk/winproto/wayland.zig +++ b/src/apprt/gtk/winproto/wayland.zig @@ -306,7 +306,7 @@ pub const Window = struct { } const wl_region = try compositor.createRegion(); - errdefer if (wl_region) |r| r.destroy(); + defer wl_region.destroy(); for (region.slices.items) |s| wl_region.add( @intCast(s.x), @intCast(s.y), @@ -315,6 +315,7 @@ pub const Window = struct { ); bg.setBlurRegion(wl_region); + self.blur_region.deinit(self.globals.alloc); self.blur_region = region; }