Дополнительные базовые модели

This commit is contained in:
2026-02-22 20:38:03 +03:00
parent 7dc7069186
commit 48824532f1
3 changed files with 87 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ canvas: Canvas,
cpu_render: *CpuRenderEngine,
frame_index: u64,
/// Открытые документы в текущем окне
documents: std.array_list.Managed(Document),
documents: std.ArrayList(Document),
pub fn init(allocator: std.mem.Allocator) !WindowContext {
var self: WindowContext = undefined;
@@ -23,13 +23,14 @@ pub fn init(allocator: std.mem.Allocator) !WindowContext {
self.canvas = Canvas.init(allocator, self.cpu_render.renderEngine());
self.frame_index = 0;
self.documents = std.array_list.Managed(Document).init(allocator);
self.documents = std.ArrayList(Document).empty;
return self;
}
pub fn deinit(self: *WindowContext) void {
self.documents.deinit();
for (self.documents.items) |*doc| doc.deinit();
self.documents.deinit(self.allocator);
self.canvas.deinit();
self.allocator.destroy(self.cpu_render);
}