AmiBlitz / AmiBlitz3

Complete package of AmiBlitz3 including all sources.
https://www.amiblitz.de/
120 stars 9 forks source link

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

Open Emsgold opened 7 months ago

Emsgold commented 7 months ago

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
honitos commented 6 months ago

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!