Lazarus

Programming => Operating Systems => macOS / Mac OS X => Topic started by: dbannon on April 17, 2019, 01:57:27 am

Title: Memory Leak in TBitBtn and heaptrc on Cocoa
Post by: dbannon on April 17, 2019, 01:57:27 am
I have just logged an bug report about a memory leak in TBitBtn, care needed ! https://bugs.freepascal.org/view.php?id=35400

But along the way, I find that heaptrc on Mac no longer send its output via lazlogger ?

For example, compile a cocoa app using a TBitbtn with an image and a debugln('debugln') line run it from command line using -

Code: [Select]
open project1.app --args "--debug-log=/some/path/log.log"

And you will see (eg) debugln() output but not heaptrc output. I suspect thats why no one has spotted that TBitBtn leak yet. Its getting too hard to check !

Instead, I found running -

Code: [Select]
./project1.app/Content/MacOS/project1
does show us the heaptrc output, is that a valid way to launch a Mac app ?  From memory, some GUI components struggle to get focus when launched like this but my demo in the bug report appeared OK.

Davo