Hello,
I found a problem with the BGRABitmap library (latest version 23/01/17).
I attach the source to the test.
In Test1() everything works but there is a memory leak while in Test2() the application closes.
Use Windows 10 64bit and Lazarus 1.6.4 64 bit FPC 3.0.2.
Thanks for every help