Open andreacomparini opened 8 years ago
Hi. Thanks for the solution. It really helped me. Btw, can u explain the reason for that?
Hi. Thanks for the solution. It really helped me. Btw, can u explain the reason for that?
Hi. When you allocate memory in dll (win) with malloc you use a specific heap of dll, not a system wide one. So you must free the same memory using the same pointer local to dll code. The way to do this is to call a public entry point that calls free on the ptr of the specific heap from which it was allocated. GEOSFree is such a public method.
Found a bug in encodeWkb() for windows. A buffer allocated in geos_c.dll whith malloc() cannot simply be freed with C.free(). Must use cGEOSFree(). Now all tests pass. The modified code follows: