Open hafedh-trimeche opened 4 years ago
I think that the ways of working with memory (managers) in C and Delphi are different (always your "Captain Obvious"). In addition, inside the dll (for OpenCV), functions also allocate and free memory for their needs (for example, for auxiliary structures and, possibly, classes). The C allocator works by knowing how to properly allocate memory for C structures and how to properly initialize memory. The Delphi allocator doesn't know. We need to figure it out ...
Hello, Thank you for your response.
But how to debug an eventual Memory Leak?
Best regards.
First you need to try to establish where this memory leak occurs, for example, by setting ReportMemoryLeaksOnShutdown: = True; Additionally, you can use some "expert", for example EurekaLog or madExcept. They show detailed information about memory leaks.
Dear,
This procedure is applicable to Memory allocated by Delphi via FastMM not for External DLL written into another language.
Would Alignment {$ALIGN} or/and {$ENUMSIZE} be the cause of the problem?
Best regards.
cvSetMemoryManager installs memory manager for functions from OpenCV (i.e. for functions from DLL)
Wanting intercept memory allocate & free, the cvSetMemoryManager is used. But exception raised: External exception E06D7363