apprt/gtk-ng: clean up some changed handlers

This commit is contained in:
Mitchell Hashimoto
2025-08-09 14:19:42 -07:00
parent ec293c1fd0
commit aed6a3a343
4 changed files with 21 additions and 17 deletions

View File

@@ -826,8 +826,10 @@ pub fn SplitTree(comptime V: type) type {
.copy = &struct {
fn copy(self: *Self) callconv(.c) *Self {
const ptr = @import("glib").ext.create(Self);
const alloc = self.arena.child_allocator;
ptr.* = self.clone(alloc) catch @panic("oom");
ptr.* = if (self.nodes.len == 0)
.empty
else
self.clone(self.arena.child_allocator) catch @panic("oom");
return ptr;
}
}.copy,