Closed kattunga closed 6 years ago
Hi Christian,
Thanks for the patch.
I want to investigate this one a bit. What kind of tool did you use to detect these leaks and maybe you can provide me with a failing case?
Thanks!
On 26 Oct 2018, at 04:26, Christian Pradelli notifications@github.com wrote:
In Win32, QrCode has lots of memory leaks because TGenericGFPoly instance are not explicitly destroyed in each function. The best solution I found to not touch the logic was to convert TGenericGFPoly in an TInterfacedObject.
You can view, comment on, or merge this pull request online at:
https://github.com/Spelt/ZXing.Delphi/pull/73 https://github.com/Spelt/ZXing.Delphi/pull/73 Commit Summary
fix to compile in Delphi 10.1 win32 lots of memory leaks removed in qrcode recognision File Changes
M Lib/Classes/2D Barcodes/Decoder/ZXing.QrCode.Internal.Decoder.pas https://github.com/Spelt/ZXing.Delphi/pull/73/files#diff-0 (9) M Lib/Classes/2D Barcodes/Detector/ZXing.QrCode.Internal.FinderPatternFinder.pas https://github.com/Spelt/ZXing.Delphi/pull/73/files#diff-1 (7) M Lib/Classes/Common/ReedSolomon/ZXing.Common.ReedSolomon.GenericGF.pas https://github.com/Spelt/ZXing.Delphi/pull/73/files#diff-2 (102) M Lib/Classes/Common/ReedSolomon/ZXing.Common.ReedSolomon.ReedSolomonDecoder.pas https://github.com/Spelt/ZXing.Delphi/pull/73/files#diff-3 (29) Patch Links:
https://github.com/Spelt/ZXing.Delphi/pull/73.patch https://github.com/Spelt/ZXing.Delphi/pull/73.patch https://github.com/Spelt/ZXing.Delphi/pull/73.diff https://github.com/Spelt/ZXing.Delphi/pull/73.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/pull/73, or mute the thread https://github.com/notifications/unsubscribe-auth/AMEt1X0vb8l2JrerwMDg0ASnWPXK_vXSks5uonLsgaJpZM4X7a9l.
Hi Spelt.
Memory leaks can be easily finded with FastMM4 or EurekaLog (https://www.eurekalog.com/)
This weekend I'll try to commit a demo that uses laptop webcam to scan QR codes in realtime. After you close the demo you will be reported with hundred of memory leaks.
Checking the code I found that several parts of the library seems to be coded to target ARC compilers (like delphi for android). this memory leaks doesn't exists on ARC platforms.
I added a VCL demo application to show memory leaks. In dpr I enabled: ReportMemoryLeaksOnShutdown := True;
So the only thing you need to do i to run application for a while scanning different kind of codes QR codes and other barcodes.
Running inside the ide in debug mode when you close application memory leaks will be reported.
In my fork I only have dotmatrix memory leaks, QR is fixed.
By the way, could you consider to move all test apps to demo folder?.
By the way, could you consider to move all test apps to demo folder?.
Sure.
Its done and your QR fix is released too. I did not want to wait.
Thanks!
Op za 27 okt. 2018 om 14:57 schreef Christian Pradelli < notifications@github.com>:
By the way, could you consider to move all test apps to demo folder?.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/pull/73#issuecomment-433618061, or mute the thread https://github.com/notifications/unsubscribe-auth/AMEt1ZQkkM9i9sHOXYdpa3VwaRz9mVMYks5upFghgaJpZM4X7a9l .
In Win32, QrCode has lots of memory leaks because TGenericGFPoly instance are not explicitly destroyed in each function. The best solution I found to not touch the logic was to convert TGenericGFPoly in an TInterfacedObject.