From: Roopesh Chander Date: Fri, 22 Mar 2019 12:23:34 +0000 (+0530) Subject: macOS: Syntax highlighter: Free spans array X-Git-Tag: 0.0.20190409-6~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4237ab4a6fa1f0175583620fc63cea1a9621d49f;p=thirdparty%2Fwireguard-apple.git macOS: Syntax highlighter: Free spans array Signed-off-by: Roopesh Chander --- diff --git a/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift b/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift index 6da5c98..3c92db3 100644 --- a/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift +++ b/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift @@ -150,6 +150,7 @@ class ConfTextStorage: NSTextStorage { var spans = highlight_config(backingStore.string)! evaluateExcludePrivateIPs(highlightSpans: spans) + let spansStart = spans while spans.pointee.type != HighlightEnd { let span = spans.pointee @@ -169,6 +170,7 @@ class ConfTextStorage: NSTextStorage { spans = spans.successor() } backingStore.endEditing() + free(spansStart) beginEditing() edited(.editedAttributes, range: fullTextRange, changeInLength: 0)