Freeing Memory?

BlitzMax Forums/BlitzMax Programming/Freeing Memory?

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.

Now I really think I have missed something. Is this taken from some commonly available code? If not, then it will be really difficult to find anything wrong with a single method without the rest of the program.
If it's a huge program then you might want to think about writing a debugger module or adding more debug statement. GCCollect will prompt GC to run even in automatic mode...
Global alllist=CreateList()
Type treferee
  Field t2:ttest
End Type
Type ttest
  Field t1:ttest1
End Type
Type ttest1
End Type
Graphics 640,480
For x = 0 To 5000
  Cls
  mynew:treferee = New treferee
  mynew.t2:ttest = New ttest
  mynew.t2.t1:ttest1=New ttest1  
  ListAddLast alllist,mynew.t2.t1
  DrawText  GCMemAlloced(),0,0
  ListRemove alllist,mynew.t2.t1
  mynew.t2 = Null
  DrawText  GCMemAlloced(),0,20
  DrawText x,0,40
  GCCollect()
  Flip
Next