From cbbce7c6b0faa5d82bf23af9c8395de35bff6d4d Mon Sep 17 00:00:00 2001 From: Michael Griebling Date: Sun, 10 Sep 2023 09:09:06 -0400 Subject: [PATCH] Update for memory leak in MTFont. --- Sources/SwiftMath/MathRender/MTFont.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/SwiftMath/MathRender/MTFont.swift b/Sources/SwiftMath/MathRender/MTFont.swift index afc1b5d..3dd3042 100644 --- a/Sources/SwiftMath/MathRender/MTFont.swift +++ b/Sources/SwiftMath/MathRender/MTFont.swift @@ -66,4 +66,9 @@ public class MTFont { /** The size of this font in points. */ public var fontSize:CGFloat { CTFontGetSize(self.ctFont) } + deinit { + self.ctFont = nil + self.defaultCGFont = nil + } + }