Is this a bug?

BlitzMax Forums/BlitzMax Beginners Area/Is this a bug?

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.

Test this one:

Type BaseObject
	Global list:TList
	Global IDCount
	Field ID
	Field Link:TLink
	Function Get_Object:BaseObject(_ID)
		Local o:baseobject
		For o = EachIn List
			If o.ID = _ID Then
				Return o
			End If
		Next
		Return Null
	End Function
	
	Method New()
		If List = Null Then List = CreateList()
		Link=list.Addlast(Self)
		IDCount :+ 1
		ID = IDcount
		Print("BaseObj::New()")
	End Method
	
	Method Get_ID:Int()
		Return ID
	End Method
	
	Method Remove()
		Link.Remove()
		If CountList(List) = 0 Then List=Null;Print "List is Emty!"
		Flushmem()
	End Method
End Type

 
Type Testtype Extends BaseObject
	Field A
	Field B	
	
	Method New()
		Print("Testype::New()")
	End Method
	
	Method Delete()
		Print("Testype::Delete()")
	End Method
	
		'--------e---------------
	Function Create_Test()
		Local Test:Testtype
		test = New testtype
		Return test.ID
	End Function
	
End Type
 

Local A:testtype = New testtype
Notify A.Get_ID()



Local B:testtype = New testtype

Notify B.Get_ID()

A.Remove()
B.Remove()

B = Null

A = Null

FlushMem

FlushMem


End