diff options
author | Roopesh Chander <roop@roopc.net> | 2019-03-22 17:53:34 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2019-03-22 17:53:34 +0530 |
commit | 4237ab4a6fa1f0175583620fc63cea1a9621d49f (patch) | |
tree | e216577ca2b2d638f096d51c7faad7f066911f28 | |
parent | macOS: Hide exclude private IPs when PrivateKey / PublicKey is missing (diff) | |
download | wireguard-apple-4237ab4a6fa1f0175583620fc63cea1a9621d49f.tar.xz wireguard-apple-4237ab4a6fa1f0175583620fc63cea1a9621d49f.zip |
macOS: Syntax highlighter: Free spans array
Signed-off-by: Roopesh Chander <roop@roopc.net>
-rw-r--r-- | WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift | 2 |
1 files changed, 2 insertions, 0 deletions
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) |