diff options
| author | Rye <rye@alchemyviewer.org> | 2025-08-20 18:04:55 -0400 |
|---|---|---|
| committer | Rye <rye@alchemyviewer.org> | 2025-08-20 18:04:55 -0400 |
| commit | ba30737d8f4add8ddd8c77d18df6497b46583fe9 (patch) | |
| tree | 81e5412a364ff80b5250fe6db9e653d35621c20e /indra/llwindow/llopenglview-objc.mm | |
| parent | f0db568bf8d313a00e10c1c4ee4dd7f716a9d987 (diff) | |
| parent | d5f748c91c650a2ec534c497b9e098ccb317d70b (diff) | |
Merge branch 'develop' of github.com:secondlife/viewer into rye/infinitemac
Diffstat (limited to 'indra/llwindow/llopenglview-objc.mm')
| -rw-r--r-- | indra/llwindow/llopenglview-objc.mm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index d40e549559..58a17227a7 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -629,7 +629,7 @@ attributedStringInfo getSegments(NSAttributedString *str) }; int string_length = [aString length]; - unichar* text = (unichar*)malloc(sizeof(unichar) * string_length); + unichar *text = new unichar[string_length]; attributedStringInfo segments; // I used 'respondsToSelector:@selector(string)' // to judge aString is an attributed string or not. @@ -647,7 +647,6 @@ attributedStringInfo getSegments(NSAttributedString *str) segments.seg_standouts.push_back(true); } setMarkedText(text, selected, replacement, string_length, segments); - free(text); if (string_length > 0) { mHasMarkedText = TRUE; @@ -658,6 +657,8 @@ attributedStringInfo getSegments(NSAttributedString *str) // we must clear the marked text when aString is null. [self unmarkText]; } + + delete [] text; } else { if (mHasMarkedText) { |
