20 July, 2022

EurekaLog erases my bitmap? (even VCL has bugs)

We were contacted by a client who claimed that EurekaLog was erasing his image in a program. In particular, it was claimed that the client's code "worked great" until EurekaLog was added to the application. After adding EurekaLog, the previously "working" code stopped working, clearing the image instead (e.g. the code's result was blank instead of expected image). The client also claimed that if the "Extended memory manager" option in EurekaLog is disabled - everything works fine again. But if this option is enabled - nothing works, even if all other memory debugging options are disabled.

Simplified code looks really simple:
Buffer := TBitmap.Create;
  Buffer.SetSize(64, 64);
  Buffer.Canvas.StretchDraw(Rect(0, 0, 64, 64), Bitmap); 
  Bitmap.SetSize(64, 64);
  Bitmap.Canvas.Draw(0, 0, Buffer); 
Do you see a problem in that code?