From 40b4183b1ffbf4d88b1060099c8549f2b40ca6d1 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 2 Apr 2024 11:16:50 -0700 Subject: [PATCH] font: Collection deinit --- src/font/Collection.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/font/Collection.zig b/src/font/Collection.zig index a7e87d898..64453fc39 100644 --- a/src/font/Collection.zig +++ b/src/font/Collection.zig @@ -42,7 +42,7 @@ pub fn deinit(self: *Collection, alloc: Allocator) void { entry.value.deinit(alloc); } - //self.load_options.deinit(alloc); + if (self.load_options) |*v| v.deinit(alloc); } pub const AddError = Allocator.Error || error{ @@ -164,6 +164,10 @@ pub const LoadOptions = struct { /// must use the same allocator as the collection. metric_modifiers: Metrics.ModifierSet = .{}, + pub fn deinit(self: *LoadOptions, alloc: Allocator) void { + self.metric_modifiers.deinit(alloc); + } + /// The options to use for loading faces. fn faceOptions(self: *const LoadOptions) font.face.Options { return .{