Bugzilla – Attachment 194356 Details for
Bug 158914
Calc leaks RAM when using macOS accessibility
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Patch for debugging AquaA11yWrapper memory leaks
AquaA11yWrapper_debug_patch.txt (text/plain), 2.11 KB, created by
Patrick Luby (volunteer)
on 2024-05-26 00:16:10 UTC
(
hide
)
Description:
Patch for debugging AquaA11yWrapper memory leaks
Filename:
MIME Type:
Creator:
Patrick Luby (volunteer)
Created:
2024-05-26 00:16:10 UTC
Size:
2.11 KB
patch
obsolete
>diff --git a/vcl/osx/a11yfactory.mm b/vcl/osx/a11yfactory.mm >index 27b5ad2d81f2..f643075a44fd 100644 >--- a/vcl/osx/a11yfactory.mm >+++ b/vcl/osx/a11yfactory.mm >@@ -170,6 +170,7 @@ +(void)removeFromWrapperRepositoryFor: (css::uno::Reference < css::accessibility > if ( theWrapper != nil ) { > [ [ AquaA11yFactory allWrapper ] removeObjectForKey: [ AquaA11yFactory keyForAccessibleContext: rxAccessibleContext ] ]; > [ theWrapper setDisposed ]; >+fprintf(stderr, "There 0: %lu %lu\n", [ [ AquaA11yFactory allWrapper ] count ], [ theWrapper retainCount ]); > [ theWrapper release ]; > } > } >@@ -184,6 +185,7 @@ +(void)registerWrapper: (AquaA11yWrapper *) theWrapper { > +(void)revokeWrapper: (AquaA11yWrapper *) theWrapper { > if ( enabled && theWrapper ) { > [ AquaA11yFactory removeFromWrapperRepositoryFor: [ theWrapper accessibleContext ] ]; >+fprintf(stderr, "There 1: %lu %lu\n", [ [ AquaA11yFactory allWrapper ] count ], [ theWrapper retainCount ]); > } > } > >diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm >index 3793b3232d7d..f3edc78e8117 100644 >--- a/vcl/osx/a11ywrapper.mm >+++ b/vcl/osx/a11ywrapper.mm >@@ -67,23 +67,38 @@ @interface SalFrameWindow : NSWindow > return s << [[obj description] UTF8String]; > } > >+static std::map<AquaA11yWrapper*, AquaA11yWrapper*> aWrapperMap; >+ > @implementation AquaA11yWrapper > > #pragma mark - > #pragma mark Init and dealloc > > -(id)init { >- return [ super init ]; >+ self = [ super init ]; >+ if ( self ) >+ aWrapperMap[self] = self; >+ return self; > } > > -(id)initWithAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext { > self = [ super init ]; > if ( self ) { >+ aWrapperMap[self] = self; > [ self setDefaults: rxAccessibleContext ]; > } > return self; > } > >+-(void)dealloc >+{ >+ auto it = aWrapperMap.find(self); >+ if (it != aWrapperMap.end()) >+ aWrapperMap.erase(it); >+fprintf(stderr, "Here dtor: %lu\n", aWrapperMap.size()); >+ [ super dealloc ]; >+} >+ > -(void)setDisposed { > // Related: tdf#148453 Acquire solar mutex during native accessibility calls > SolarMutexGuard aGuard;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 158914
:
194184
| 194356