~novakane/zelbar

d3335d1e132975ecdbe00eaeca07011c512c5969 — Hugo Machet 1 year, 2 months ago 79788da
Backend: Use null data instead of undefined
1 files changed, 2 insertions(+), 2 deletions(-)

M src/Backend.zig
M src/Backend.zig => src/Backend.zig +2 -2
@@ 380,7 380,7 @@ const Surface = struct {

const Buffer = struct {
    wl_buffer: ?*wl.Buffer = null,
    data: []align(std.mem.page_size) u8 = undefined,
    data: ?[]align(std.mem.page_size) u8 = null,
    pixman_image: ?*pixman.Image = null,

    width: u31 = 0,


@@ 436,7 436,7 @@ const Buffer = struct {
    fn deinit(buffer: Buffer) void {
        if (buffer.pixman_image) |pix| _ = pix.unref();
        if (buffer.wl_buffer) |wl_buffer| wl_buffer.destroy();
        os.munmap(buffer.data);
        if (buffer.data) |data| os.munmap(data);
    }

    fn buffer_listener(_: *wl.Buffer, event: wl.Buffer.Event, buffer: *Buffer) void {