From 9c0049cfae49c8e4ddef9125a69db2ad134c10c6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 7 Jun 2024 13:48:25 +0200 Subject: Merging upstream version 4:24.2.4. Signed-off-by: Daniel Baumann --- vcl/osx/a11yactionwrapper.mm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'vcl/osx/a11yactionwrapper.mm') diff --git a/vcl/osx/a11yactionwrapper.mm b/vcl/osx/a11yactionwrapper.mm index 9bea25c119..f9c5089a19 100644 --- a/vcl/osx/a11yactionwrapper.mm +++ b/vcl/osx/a11yactionwrapper.mm @@ -55,16 +55,22 @@ NSMutableArray * actionNames = [ [ NSMutableArray alloc ] init ]; if ( [ wrapper accessibleAction ] ) { for ( int cnt = 0; cnt < [ wrapper accessibleAction ] -> getAccessibleActionCount(); cnt++ ) { - [ actionNames addObject: [ AquaA11yActionWrapper nativeActionNameFor: CreateNSString ( [ wrapper accessibleAction ] -> getAccessibleActionDescription ( cnt ) ) ] ]; + // Related tdf#158914: explicitly call autorelease selector + // CreateNSString() is not a getter. It expects the caller to + // release the returned string. + [ actionNames addObject: [ AquaA11yActionWrapper nativeActionNameFor: [ CreateNSString ( [ wrapper accessibleAction ] -> getAccessibleActionDescription ( cnt ) ) autorelease ] ] ]; } } - return actionNames; + return [actionNames autorelease]; } +(void)doAction:(NSString *)action ofElement:(AquaA11yWrapper *)wrapper { if ( [ wrapper accessibleAction ] ) { for ( int cnt = 0; cnt < [ wrapper accessibleAction ] -> getAccessibleActionCount(); cnt++ ) { - if ( [ action isEqualToString: [ AquaA11yActionWrapper nativeActionNameFor: CreateNSString ( [ wrapper accessibleAction ] -> getAccessibleActionDescription ( cnt ) ) ] ] ) { + // Related tdf#158914: explicitly call autorelease selector + // CreateNSString() is not a getter. It expects the caller to + // release the returned string. + if ( [ action isEqualToString: [ AquaA11yActionWrapper nativeActionNameFor: [ CreateNSString ( [ wrapper accessibleAction ] -> getAccessibleActionDescription ( cnt ) ) autorelease ] ] ] ) { [ wrapper accessibleAction ] -> doAccessibleAction ( cnt ); break; } -- cgit v1.2.3