Hi, I have checked backwards. And as you said there was an error before that. Here is the area in which the error occures ( I think ):
This code is from a place where I try to read a file. I know that the file is correct since it works in debuggers. But when I run the exe, something strange seems to happen with all the strings and it looses them.
fread(&temp, sizeof(int), 1, file);
if (temp > 255 || temp < 1)
MessageBox(NULL, "Invalid mapname", "Error", MB_OK);
worldFileName = new char[temp]; // This line makes "new" go crazy...
catch (std::bad_alloc &)
MessageBox(NULL, "AIIEEE, out of memory", "Error", MB_OK);
readStr(temp, worldFileName, file);
memset(worldFileName+temp, 0, strlen(worldFileName) - temp);
MessageBox(NULL, worldFileName, "Info", MB_OK);
WE_ERROR("Testing dummy3", EH_MBERROR, mainLog);
int *dummy3 = new int; // <---- This new works
WE_ERROR("Dummy3 okay", EH_MBERROR, mainLog);
TdsLoader *modelLoader = new TdsLoader; // <--- This don't, it crashes
Thanks for your replies