Freeing Memory?

BlitzMax Forums/BlitzMax Programming/Freeing Memory?

I would have though thay setting m_pTGamePlayScreen = Null would have freed the memory?


It does, I think, but only the next time GC is run.
In the following case GC is run at x=42 (for me)...
Type ttest
End Type
Graphics 640,480
For x = 0 To 50
  Cls
  mynew:ttest = New ttest
  DrawText  GCMemAlloced(),0,0
  mynew = Null
  DrawText  GCMemAlloced(),0,20
  DrawText x,0,40
  Flip
  WaitKey()
Next