/languagetool/

a> index : lo/core
LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/vcl/osx/a11ywrapperradiobutton.mm
AgeCommit message (Collapse)Author
2024-06-03Related tdf#158914: fix memory leaks by calling (auto)release selectorsPatrick Luby
Found the following memory leaks using Xcode's Instruments application: 1. Posting an NSAccessibilityUIElementDestroyedNotification notification causes [ AquaA11yWrapper isAccessibilityElement ] to be called on the object so mark the object as disposed before posting the destroyed notification and test for disposed in all of the standard NSAccessibility selectors to prevent any calls to likely disposed C++ accessibility objects. 2. In [ AquaA11yWrapper accessibilityHitTest: ], [ AquaA11yFactory wrapperForAccessibleContext: ] already retains the returned object so retaining it until the next call to this selector can lead to a memory leak when dragging selected cells in Calc to a new location. So autorelease the object so that transient objects stay alive but not past the next clearing of the autorelease pool. 3. [ AquaA11ySelectionWrapper selectedChildrenAttributeForElement: ] is expected to return an autoreleased object. 4. [ AquaA11yFactory wrapperForAccessible: ] is not a getter. It expects the caller to release the returned object. 5. CreateNSString() is not a getter. It expects the caller to release the returned string. Change-Id: I824740d7e3851b0c3e31e2c009860aa822c94222 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168034 Reviewed-by: Patrick Luby <guibomacdev@gmail.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins (cherry picked from commit 0735a4306da86c6fa0390b85f1f391ec404b2699) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168057 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-01-20tdf#148453 Fix crash by turning off optimization for Objective-C selectorPatrick Luby
The default attributes sequence sometimes crashes when it is released but only when compiler optimization is enabled, so disable optimization for the +[AquaA11yTextAttributesWrapper createAttributedStringForElement] selector. Also, disabling optimization by itself is apparently not enough to stop the crashing. Acquiring the solar mutex during native accessibility calls is also needed. Native accessibility calls are called from native input sources in [NSApp nextEventMatchingMask:untilDate:inMode:dequeue:]. Since AquaSalInstance::DoYield() releases the solar mutex before calling [NSApp nextEventMatchingMask:untilDate:inMode:dequeue:], we need to always acquire the solar mutex during all NSAccessibility selectors (both the old informal protocol and the newer formal protocol) that we implement. Change-Id: I9b715e17e9c5a32b7ce28815e288b2af236c3cc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145742 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>