AmiBlitz/AmiBlitz3

Memory leak in linked list + crash on Kick/WB 1.3

Opened this issue · 1 comments

In AmiBlitz 3.9.9 the new "real" dynamic linked list (DIM List xyz.s(0)) causes a big memory leak on all OS versions and also crashes on Kick/WB 1.3.

If I use the "old" syntax "DIM List xyz.s(8000)", I don't seem to lose memory and it does NOT crash on 1.3.

Example:

Dim List xyz.s(0)
ResetList xyz()
     For i = 1 To 8000
       If AddItem(xyz()) Then xyz() = "Test!"
     Next
NPrint "The End"
MouseWait
End

I found out that there was a OS-version-check missing when allocation memory for a new dataset.
That led to the crash on Kick1.3, as the function uses AllocPooled()-function that is only available from OS2.0 on.

As far as the memory leak is concerned: the implementation is incomplete!
The memory allocation is implemented, but the allocated memory is never been freed!