macOS: Syntax highlighter: Free spans array

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2019-03-22 17:53:34 +05:30
parent 0fcaf6debb
commit 4237ab4a6f
1 changed files with 2 additions and 0 deletions

View File

@ -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)