summaryrefslogtreecommitdiffstats
path: root/vcl/osx/a11yselectionwrapper.mm
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/osx/a11yselectionwrapper.mm')
-rw-r--r--vcl/osx/a11yselectionwrapper.mm12
1 files changed, 10 insertions, 2 deletions
diff --git a/vcl/osx/a11yselectionwrapper.mm b/vcl/osx/a11yselectionwrapper.mm
index 9d3beee2d3..4c9d1c7bfc 100644
--- a/vcl/osx/a11yselectionwrapper.mm
+++ b/vcl/osx/a11yselectionwrapper.mm
@@ -34,10 +34,13 @@ using namespace ::com::sun::star::uno;
Reference< XAccessibleSelection > xAccessibleSelection = [ wrapper accessibleSelection ];
if( xAccessibleSelection.is() )
{
- NSMutableArray * children = [ [ NSMutableArray alloc ] init ];
try {
sal_Int64 n = xAccessibleSelection -> getSelectedAccessibleChildCount();
+ // Related tdf#158914: implicitly call autorelease selector
+ // Callers expect this selector to return an autoreleased object.
+ NSMutableArray * children = [ NSMutableArray arrayWithCapacity: n ];
+
// Fix hanging when selecting a column or row in Calc
// When a Calc column is selected, the child count will be
// at least a million. Constructing that many C++ Calc objects
@@ -49,7 +52,12 @@ using namespace ::com::sun::star::uno;
n = MAXIMUM_ACCESSIBLE_TABLE_CELLS;
for ( sal_Int64 i=0 ; i < n ; ++i ) {
- [ children addObject: [ AquaA11yFactory wrapperForAccessible: xAccessibleSelection -> getSelectedAccessibleChild( i ) ] ];
+ // Related tdf#158914: explicitly call release selector
+ // [ AquaA11yFactory wrapperForAccessible: ] is not a getter.
+ // It expects the caller to release the returned object.
+ id child_wrapper = [ AquaA11yFactory wrapperForAccessible: xAccessibleSelection -> getSelectedAccessibleChild( i ) ];
+ [ children addObject: child_wrapper ];
+ [ child_wrapper release ];
}
return children;