feat(core): fix segfault

This commit is contained in:
2025-04-23 17:41:51 +02:00
parent 490425bfd9
commit 8a39c36aa8
3 changed files with 71 additions and 50 deletions

View File

@@ -17,11 +17,12 @@ pub const Tab = struct {
currentItemsAllocator: ?std.heap.ArenaAllocator,
};
pub fn create(
pub fn init(
self: *Tab,
threadPool: *std.Thread.Pool,
allocator: std.mem.Allocator,
) Tab {
return Tab{
) void {
self.* = Tab{
.allocator = allocator,
.currentItems = null,
.currentLocation = null,
@@ -56,10 +57,11 @@ pub const Tab = struct {
pub fn deinit(self: *Tab) void {
if (self.currentLocation) |c| {
c.deinit();
c.item.deinit();
}
if (self._private.currentItemsAllocator) |arena| {
arena.deinit();
}
self.allocator.destroy(self);
}
};