refactor: lots more writergate fixes - first successful build

This commit is contained in:
CJ van den Berg 2025-09-25 22:01:29 +02:00
parent 5094aa8c85
commit bf0d4402ea
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
48 changed files with 404 additions and 413 deletions

View file

@ -14,18 +14,18 @@ widgets: ArrayList(Widget),
pub fn init(allocator: Allocator) Self {
return .{
.allocator = allocator,
.widgets = ArrayList(Widget).init(allocator),
.widgets = .empty,
};
}
pub fn deinit(self: *Self) void {
for (self.widgets.items) |*widget|
widget.deinit(self.allocator);
self.widgets.deinit();
self.widgets.deinit(self.allocator);
}
pub fn add(self: *Self, widget: Widget) !void {
(try self.widgets.addOne()).* = widget;
(try self.widgets.addOne(self.allocator)).* = widget;
}
pub fn swap(self: *Self, n: usize, widget: Widget) Widget {