@Perturbatio: you do not understand. BBmax newer delete somethink, if you set a reference to a type-object in other variables
Local test1:Tmytype=New Tmytype
Local test2:Tmytype=test1
test1=NULL
FlushMem
and if you forgot test2 - you do not delete this object...
ok - but what, if you create somewhere lists and you forget this list
The problem is other:
In classic BB:
DELETE - if you call it - you delete your object in this time (ok memory was not reallocated, but its ok - you have no access to this, and new object take the memory from deleted object - and all other variables that linked to this type have value NULL - nice!!!!!!!!)
In BBmax:
var=NULL - you don't know. do you remove it or not. you have only a chance with user definded delete-functions, that remove objects from lists. after you call FlushMem you don't know what obj. was deleted or not-you have no guarantie for this. Other variables can link to a object (<>NULL) and bbmax don't kill this objects... this is abit harder to write applications. if you create list and newer reference obj. in other variables - you have good clean programs (partikel effects). if you create gui - where you use returned object - you have unclean sources (postet on top)... you have only a chance using ID-number or something...
Local test1:Tmytype=New Tmytype
Local test2:Tmytype=test1
test1=NULL
FlushMem
and if you forgot test2 - you do not delete this object...
ok - but what, if you create somewhere lists and you forget this list
The problem is other:
In classic BB:
DELETE - if you call it - you delete your object in this time (ok memory was not reallocated, but its ok - you have no access to this, and new object take the memory from deleted object - and all other variables that linked to this type have value NULL - nice!!!!!!!!)
In BBmax:
var=NULL - you don't know. do you remove it or not. you have only a chance with user definded delete-functions, that remove objects from lists. after you call FlushMem you don't know what obj. was deleted or not-you have no guarantie for this. Other variables can link to a object (<>NULL) and bbmax don't kill this objects... this is abit harder to write applications. if you create list and newer reference obj. in other variables - you have good clean programs (partikel effects). if you create gui - where you use returned object - you have unclean sources (postet on top)... you have only a chance using ID-number or something...