On Wed Nov 29 16:31:39 2023 +0000, Alex Henrie wrote:
That was a mistake, thank you for catching it. I was thinking that the Clone functions needed to use GdipAlloc for the memory that they return to the caller. Then I found https://www.winehq.org/pipermail/wine-patches/2015-October/142735.html which makes it clear that they should _not_ use GdipAlloc, but I forgot to change GdipCloneRegion back. By the way, unlike Sebastian's patch, in v3 I did change anything that uses heap_alloc_zero(size) and then immediately overwrites the entire buffer to malloc(size) instead of calloc(1, size). Using calloc when we don't actually want to zero-initialize the buffer made the code look strange and overcomplicated.
I noticed that. It was probably originally done that way because it's how GdipAlloc functions.