Additional .Net Fixes

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Deis
Posts: 8
Joined: Sun Jun 26, 2005 4:02 pm

Additional .Net Fixes

Post by Deis »

Anytime a Marshal method is called, the memory must be freed after we are done with the object.

For example this line:

Code: Select all

char* str = (char*)(void*) System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(name);
The str pointer needs to be freed with:

Code: Select all

System::Runtime::InteropServices::Marshal::FreeHGlobal(str);
The following files/methods are affected by this memory leak:

IAnimatedMeshMD2.cpp Line 28
IAnimatedMeshSceneNode.cpp Line 58 and 76
IFileSystem.cpp Line 29
IGuiEnvironment.cpp Line 36
ISceneManager.cpp Line 27, 219, and 474

Also IGUIFont.cpp is affect, as presented in this post.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Yes, thanks, that quite bad, it will be corrected in the next version.
Post Reply