Memory leaks detected by leaks command line tool

Hello,
I am developing an application for macOSX on Mojave (10.14.6) and Xcode (11.3.1) and I would like to understand an issue, as follows:

If I run may application and while it is running I run the macOSX's leaks command line tool, it reports always a very small memory leak and it is always constant as long as I do not run any modules that call either NSOpenPanel(and selects a file) or NSPrintOperation(and save report as PDF).

If I run a module that calls either NSOpenPanel(and I select a file) or NSPrintOperation(and I choose not to print but to save as PDF), then if I run the leaks tools right after one of these operations takes place, the leaks command line tool reports an increase in memory leaks which increases every time the Application calls either NSOpenPanel(and selects a file) or NSPrintOperation(and I choose to save as PDF), otherwise it does not report any increase in leaked bytes).

When I run ps command line tool, I can also notice that every time I call either NSOpenPanel(and select a file) or NSPrintOperation(and I choose to save as PDF), the amount of memory ps reports for my Application increases, so in fact there must really be a memory leak.

Does anybody know why this happens and how to fix it?

I also noticed that if I run the leaks command line utility and inform as its parameter the "Finder.app" PID running on my machine, it reports an enormous amount of leaked memory bytes! So, it may be something related to calls to internal system library functions on macOSX.

Can anyone have an explanation for this and how can this be fixed?

Thanks a lot!

This is part of the leaks output when I pass Finder.app PID as its parameter, since the whole of it is extremely big:
Code Block marcoss-iMac:bin marcos$ leaks 445
Process: Finder [445]
Path: /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
Load Address: 0x108349000
Identifier: com.apple.finder
Version: 10.14.7 (1143.7.1)
Build Info: Finder_FE-1143007001000000~1
Code Type: X86-64
Parent Process: ??? [1]
Date/Time: 2021-05-13 11:27:00.823 -0300
Launch Time: 2021-05-03 13:00:06.637 -0300
OS Version: Mac OS X 10.14.6 (18G9028)
Report Version: 7
Analysis Tool: /Applications/Xcode.app/Contents/Developer/usr/bin/leaks
Analysis Tool Version: Xcode 11.3.1 (11C504)
Physical footprint: 434.0M
Physical footprint (peak): 596.4M
----
leaks Report Version: 4.0
Process 445: 507612 nodes malloced for 68175 KB
Process 445: 4335 leaks for 239792 total leaked bytes.
4335 (234K) << TOTAL >>
74 (5.95K) ROOT LEAK: <NSArray 0x600000300960> [16]
73 (5.94K) __strong _object --> <NSExtension 0x600003400900> [192]
49 (3.95K) __plugIn --> <PKHostPlugIn 0x7fe85fc51a80> [352]
19 (1.44K) __strong _sourceForm --> <NSDictionary 0x600000143ca0> [32]
17 (1.39K) <NSDictionary (Storage) 0x7fe82fc1fe70> [368]
11 (688 bytes) <NSDictionary 0x600003838380> [224] item count: 8
2 (112 bytes) <NSDictionary 0x6000014363c0> [64] item count: 3
1 (48 bytes) <CFString 0x600000f34c00> [48] length: 20 "com.apple.FinderSync"
2 (64 bytes) <NSArray 0x600000330210> [16]
1 (48 bytes) __strong _object --> <CFString 0x600000f34ba0> [48] length: 29 "FIFinderSyncService_Subsystem"
1 (64 bytes) _list --> <CFString 0x600001436480> [64] length: 38 "_NSExtensionHostRequiresDedicatedQueue"
1 (48 bytes) <CFString 0x600000f34990> [48] length: 20 "com.apple.FinderSync"
1 (48 bytes) <CFString 0x600000f34a20> [48] length: 25 "FIFinderSyncExtensionHost"
1 (48 bytes) <CFString 0x600000f34ab0> [48] length: 21 "FIFinderSyncExtension"
1 (48 bytes) <CFString 0x600000f34cf0> [48] length: 20 "com.apple.FinderSync"
1 (32 bytes) <CFString 0x600000134440> [32] length: 10 "FinderSync"
1 (112 bytes) <CFString 0x600002a3caf0> [112] length: 79 "/Applications/Sync.app/Contents/Resources/Setup.app/Contents/PlugIns/Sync.appex"
1 (80 bytes) <CFString 0x600002234d70> [80] length: 51 "/Applications/Sync.app/Contents/Resources/Setup.app"
1 (64 bytes) <CFString 0x600001436300> [64] length: 32 "localizedFileProviderActionNames"
1 (64 bytes) <CFString 0x600001436440> [64] length: 36 "17D6BD3D-D242-4C08-9588-1D86763FCBA7"
1 (48 bytes) <CFString 0x600000f34a80> [48] length: 17 "service-extension"
1 (16 bytes) cow --> <NSDictionary.cow (struct __cow_state_t) 0x60000032aeb0> [16]
9 (576 bytes) __strong _plugInDictionary --> <NSDictionary 0x6000038382a0> [224] item count: 8
2 (64 bytes) <NSArray 0x6000003301e0> [16]
1 (48 bytes) __strong _object --> <CFString 0x600000f34900> [48] length: 29 "FIFinderSyncService_Subsystem"
1 (64 bytes) _list --> <CFString 0x600001436380> [64] length: 38 "_NSExtensionHostRequiresDedicatedQueue"
1 (48 bytes) <CFString 0x600000f34840> [48] length: 20 "com.apple.FinderSync"
1 (48 bytes) <CFString 0x600000f349c0> [48] length: 21 "FIFinderSyncExtension"
1 (48 bytes) <CFString 0x600000f349f0> [48] length: 20 "com.apple.FinderSync"
1 (48 bytes) <CFString 0x600000f34c60> [48] length: 25 "FIFinderSyncExtensionHost"
1 (32 bytes) <CFString 0x6000001349c0> [32] length: 10 "FinderSync"
2 (288 bytes) __strong _discoveryExtensions --> <NSDictionary 0x600000134420> [32]