font/coretext: fix small memory leak

This commit is contained in:
Qwerasd
2025-07-02 11:02:33 -06:00
parent 776d25b065
commit 2a836b0ab7

View File

@ -109,7 +109,8 @@ pub const Shaper = struct {
/// settings the font features of a CoreText font.
fn makeFeaturesDict(feats: []const Feature) !*macos.foundation.Dictionary {
const list = try macos.foundation.MutableArray.create();
errdefer list.release();
// The list will be retained by the dict once we add it to it.
defer list.release();
for (feats) |feat| {
const value_num: c_int = @intCast(feat.value);