CPU leak!

Blitz3D Forums/Blitz3D Programming/CPU leak!

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

I dont know of a way to do that with the Blitz command set but...

what if you, independantly from all your game data, created a data type that kept track of the pivots by replacing the createpivot() and freeentity() commands?

Type pivot
	Field mem
End Type

Function makePivot()
	entity.pivot=New pivot
	entity\mem=CreatePivot()
	Return entity\mem
End Function
Function freePivot(mem)
	For entity.pivot=Each pivot
		If entity\mem=mem
			FreeEntity mem
			Delete entity
			entity.pivot=Last pivot
		EndIf
	Next
End Function
Function flushPivots()
	For entity.pivot=Each pivot
		FreeEntity entity\mem
		Delete entity
	Next
End Function