Memory leak problem

Surge

18-04-2007 18:51:26

Hi,

I am detecting a memory leak in .NET application using the Ogre .NET wrapper. It occurs when i repeatedly call GetDirection() function on a a Camera object.

When i am running application in DEBUG mode, I get log of all the detected memory leaks in the OGRE libraries. Namely:

7262 memory leaks found:

Alloc. Addr Size Addr Size BreakOn BreakOn
Number Reported Reported Actual Actual Unused Method Dealloc Realloc Allocated by
------ ---------- ---------- ---------- ---------- ---------- -------- ------- ------- ---------------------------------------------------
004207 0x096BD608 0x0000000C 0x096BD5F8 0x0000002C 0x00000000 new N N ogrebindings_wrap.cxx(47781) CSharp_Camera_GetDirection
004210 0x096BDFE0 0x0000000C 0x096BDFD0 0x0000002C 0x00000000 new N N ogrebindings_wrap.cxx(47781) CSharp_Camera_GetDirection
004211 0x096BE038 0x0000000C 0x096BE028 0x0000002C 0x00000000 new N N ogrebindings_wrap.cxx(47781) CSharp_Camera_GetDirection

... and so on ....


From what i can see, the problem lies in the fact that a new Ogre::Vector3 is instantiated in ogrebindings_wrap.cxx on line 47781 whenever i call GetDirection() (in .NET app). However this object is not deallocated upon cleanup (by the garbage collector) of OgreVector3 (created in Camera.cs on line 294) object, because second parameter passed into its constructor is false.

Has anybody seen this behaviour?

Thanks in advance.