Leak in iMiniB3D

BlitzMax Forums/MiniB3D Module/Leak in iMiniB3D

ima747(Posted 2010) [#1]
Running a leak test on my current project lead to Matrix.h
in Inverse()
Matrix* mat=new Matrix;

I am not using any bones and the only other place it is called appears to be camera.mm in Camera.Update() which would make sense since it leaks at regular intervals.

Adding
delete(new_mat);
after the mod_mat changes in Camera.mm Update() function clears the new mat created from the inverse call on line 511 and seems to correct the leak without any adverse affects.


jhocking(Posted 2010) [#2]
ah thanks

EDIT: er where did you add that line exactly? I don't see any new_mat anywhere to delete.


ima747(Posted 2010) [#3]
Sory, updated now, it created a new_mat on line 511 in the Inverse() function in camera.mm... all the other lines etc. came from the leak checker. quite confusing, my bad.


simonh(Posted 2010) [#4]
Thanks, fixed it in my version.