feat(core): fix segfault
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user