Memory Leak in CopyEntity()?

BlitzMax Modules Forums/MiniB3D/Memory Leak in CopyEntity()?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

This works sometimes, sometimes not, and when I set nm=20000 it never works, and the program crashes with the error "Unhandled Exception:Unhandled Memory Exception Error" at the line with CopyEntity(). I'm using MiniB3D Extended 0.41.

Global mesh0:TEntity=LoadMesh("oildrum2.b3d")
Const nm:Long=10000:Long
Global mesh:TEntity
Global n:Long
For n=1 To nm
	mesh=mesh0.CopyEntity()
	PositionEntity mesh,Rnd(-8000,8000),0,Rnd(-8000,8000)
	RotateEntity mesh,0,Rnd(360),0
Next