Cyclic Objects

BlitzMax Forums/BlitzMax Programming/Cyclic Objects

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.

It seems that if an object creates an instance of object2 (which object2 creates a new list) then a cyclic pattern occurs. Why? How can this be fixed?

Here is an example and a screen shot of the debug that cycles infinitely....

Type TParent
	Field cycle:TCycle = New TCycle 
EndType 

Type TCycle
	Field list:TList = New TList 
EndType 

Global parent:TParent = New TParent
FlushMem
DebugStop