diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-09-17 21:37:49 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-09-18 00:11:42 +0200 |
commit | 11fcdecb631fef7797da9489ea36468e292e2986 (patch) | |
tree | 70be0cda4b63d626e69cff1cad6ff16ff9152213 /lingucomponent | |
parent | dd5868409ae430f9c9ffea18ea7e287a65cfa2ab (diff) |
Related tdf#112425: fix another leak in MacSpellChecker
Apply the same changes in GetProposals than GetSpellFailure
Change-Id: Id78966568833f29c21f44724974254218636597d
Reviewed-on: https://gerrit.libreoffice.org/42397
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'lingucomponent')
-rw-r--r-- | lingucomponent/source/spellcheck/macosxspell/macspellimp.mm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm index 51e82f1dd0fb..f146db7b8dab 100644 --- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm +++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm @@ -331,13 +331,12 @@ Reference< XSpellAlternatives > if (n) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - NSString* aNSStr = [[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(nWord.getStr()) length: nWord.getLength()]; - NSString* aLang = [[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(rLocale.Language.getStr()) length: rLocale.Language.getLength() ]; + NSString* aNSStr = [[[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(nWord.getStr()) length: nWord.getLength()]autorelease]; + NSString* aLang = [[[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(rLocale.Language.getStr()) length: rLocale.Language.getLength()]autorelease]; if(rLocale.Country.getLength()>0) { - NSString* aCountry = [[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(rLocale.Country.getStr()) length: rLocale.Country.getLength() ]; + NSString* aCountry = [[[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(rLocale.Country.getStr()) length: rLocale.Country.getLength()]autorelease]; NSString* aTaggedCountry = [@"_" stringByAppendingString:aCountry]; - [aLang autorelease]; aLang = [aLang stringByAppendingString:aTaggedCountry]; } [macSpell setLanguage:aLang]; |