File: src/server/render.zig:162-190 Severity: LOW Status: ❌ FALSE POSITIVE
if (self.merged_screen) |ms_ptr| {
if (ms_ptr.* == null or ms_ptr.*.?.grid.width != merged_w or ms_ptr.*.?.grid.height != merged_h) {
if (ms_ptr.*) |*ms| {
ms.deinit();
}
ms_ptr.* = try Screen.init(allocator, merged_w, merged_h);
}
merged_screen = &(ms_ptr.*.?);
} else {
local_merged_screen = try Screen.init(allocator, merged_w, merged_h);
}
Every render checks grid width/height and potentially reallocates the merged screen. The width/height only changes on resize, so this check is almost always a no-op after the first render.
The real issue: local_merged_screen is created on the stack but Screen.init allocates its grid. When self.merged_screen is set, the local is never used but still gets a destruct path via defer.
Fix: Store the merged screen as a field on DisplayClient (not a pointer-to-pointer). Check dimensions once and cache. Only reallocate on actual resize.