Running program with debug gets EXC_BAD_ACCESS when it terminates (OSX) lazarus / 12-Debugger ---------------------------------------------------------------------- ahnz · 2019-05-01 21:12 Heres what I have ... OS: OSX High Sierra 10.13.6 Lazarus: 2.0.2 rev.61074 Widgetset: Cocoa Target: 64bit OSX Compiler: FPC 3.0.4 [2017/11/26] for x86_64 Debug: LLDB  (with fpdebug)(Beta) Path: /usr/bin/lldb Version: lldb-1000.11.38.2 Every time I run my program with debugging, when it terminates as part of normal behaviour, I get the attached error and call_stack Step #8 of the call stack refers to cocoa buttons line 217. That section of code appears to be releasing a button with a Glyph ... Quoteprocedure TCocoaButton.dealloc; begin   if Assigned(Glyph) then     FreeAndNil(Glyph);   inherited dealloc; end; My main form has  a number of TBitBtn's with glyphs, but they all seem to be setup correctly, all done in the form editor with no parameters being set in code Does anyone have any ideas on what could be causing this or where I should be looking next? Cheers PS: This appears unrelated to another issue I have poster about the use of heaptrc ---------------------------------------------------------------------- Martin_fr · 2019-05-01 21:51 There are a few cocoa/bitbtn fixes in svn trunk. I do not know if all of them are merged for the fixes branch. You can check with "svn log" and via the wiki merges page. For any info why/what/when is merged you need to ask on the mail list, to get an answer from the cocoa maintainer. ---------------------------------------------------------------------- ahnz · 2019-05-01 22:57 Thanks Martin_fr A bit more experimenting and it's definitely a problem with TBitBtn.. remove the Glyph in form editor and the issue goes away. I've been unable to clear the Glyph in code so replaced the buttons with TSpeedButton and all is fine. I'll go check the mailing etc Cheers