When i use free(), to free the memory allocated by ilCompressDX the application simply crashes on win32, on linux it
works fine, also valgrind doesn't find any invalid memory access on linux.
When using ifree() by including <IL/devil_internal_exports.h> it works fine, but this header file is only available in the full source package.
also it seems to work, when i add this:
static void* ILAPIENTRY AllocFunc(const ILsizei Size)
{
return malloc(Size);
}
static void ILAPIENTRY FreeFunc(const void * CONST_RESTRICT ptr)
{
free((void*)ptr);
}
...
ilSetMemory(AllocFunc, FreeFunc);
ilInit();
without ilSetMemory()... it crashes.
This is where it crashes: https://github.com/tizbac/SpringMapConvNG/blob/cba46fba1c66f8316789bcc8f0e648bb8dde5871/TileStorage.cpp#L154
It looks like a Heap-Corruption, but i'm not sure where it happens as valgrind doesn't work on windows.