diff options
author | Patrick Luby <patrick.luby@collabora.com> | 2023-04-12 17:17:12 -0400 |
---|---|---|
committer | Patrick Luby <plubius@neooffice.org> | 2023-04-13 18:29:50 +0200 |
commit | c10a242bf1c9c0460d0ed19f2925a91abd3d0c8b (patch) | |
tree | f3c5f55b33026b9d2cbdebd1b8007e422fae3cde | |
parent | tdf#154708 Preserve selection for repeating Shift-arrow on Japanese keyboard (diff) | |
download | core-c10a242bf1c9c0460d0ed19f2925a91abd3d0c8b.tar.gz core-c10a242bf1c9c0460d0ed19f2925a91abd3d0c8b.zip |
Related: tdf#153374 Don't release autoreleased attributeNames
Also, return an autoreleased empty array instead of a retained array.
Change-Id: I5f494b301dbae859486d6bc4874112b714022b60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150307
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@neooffice.org>
(cherry picked from commit 127eacf630e1712fd5addcabed404b2d33752311)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150316
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
-rw-r--r-- | vcl/osx/a11ywrapper.mm | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm index 73abb6050733..c4beeb5b0567 100644 --- a/vcl/osx/a11ywrapper.mm +++ b/vcl/osx/a11ywrapper.mm @@ -807,8 +807,13 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { if ( [ self accessibleValue ] ) { [ AquaA11yValueWrapper addAttributeNamesTo: attributeNames ]; } - [ nativeSubrole release ]; - [ title release ]; + if ( nativeSubrole ) { + [ nativeSubrole release ]; + } + if ( title ) { + [ title release ]; + } + // Related: tdf#153374 Don't release autoreleased attributeNames return attributeNames; } catch ( DisposedException & ) { // Object is no longer available if ( nativeSubrole ) { @@ -817,11 +822,10 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { if ( title ) { [ title release ]; } - if ( attributeNames ) { - [ attributeNames release ]; - } + // Related: tdf#153374 Don't release autoreleased attributeNames + // Also, return an autoreleased empty array instead of a retained array. [ AquaA11yFactory removeFromWrapperRepositoryFor: [ self accessibleContext ] ]; - return [ [ NSArray alloc ] init ]; + return [ NSArray array ]; } } |