Дополнительные базовые модели
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user