I am new to BlitzMax, so I wanted to experiment with the garbage collection idea to make sure I understand how it works to avoid memory leaks. In my first basic example, there appears to be a memory leak.
SuperStrict Type ta Field a%,b%,c% End Type Type tb Field a:ta End Type GCCollect() Print "0 Objects: " + GCMemAlloced() Local b:tb = New tb GCCollect() Print "1 Objects: " + GCMemAlloced() b.a = New ta GCCollect() Print "2 Objects: " + GCMemAlloced() b.a = Null ' comment this for even more leakage, since b.a apparently isn't collected after b is collected below. Or maybe b isn't being collected at all? GCCollect() Print "1 Objects: " + GCMemAlloced() b = Null GCCollect() Print "0 Objects: " + GCMemAlloced()