This started when switching to Cocoa, but I just ignore it until now...
Whenever my program closes I get error
Debugger stopped with reason: EXC_BAD_ACCESS (code=1, address=0x0)
In file 'winapi.inc' at line 180:
Result := WidgetSet.DeleteObject(GDIObject):
It appears to originate:
TCustomBitmap.Destroy->Inherited
TRasterImage.Destroy->FSharedImage.Release
TSharedImage.Release->FreeHandle
TSharedCustomBitmap.FreeHandle->Inherited
TSharedRasterImages.FreeHandle->DeleteObject(FHandle)
(winapi.inc) DeleteObject(GDIObject: HGDIOBJ): Boolean;
But any ideas? Of what I should try? This is a quite large application (about half million lines of own code - then add Indy, LCL, FPC, Virtual Treeview) with a ton of imagelists and what not, so it will be extremely tedious to remove one a a time :/
But if there maybe is anything I could check runtime (e.g. to write code to check up on all imagelists, images etc. are okay) I think maybe that could be a way forward?
...
In release builds running outside debugger I do not see this error, but I am looking into this since I have a user reporting that the program froze while closing...