Right i will get straight to he point, i have looked around before asking this, googled away and all that but i am slightly confused.
I come from the pascal/Delphi world and in that world everything that is created must be free'd (FreeAndNil to be exact) inside of a destructor which is inherited then overrided from the base object TObject.
Now its been a while since i looked into haxe and haxeflixel but the last time i did the tutorial on the site mentioned a class (FlxDestroyUtil i think) which was being used in the destructor (i think it said "everything that is created must be destroyed"), now i am looking at the tutorial and i downloaded the latest version of haxeflixel and cannot see the overridden destructor method in the playstate class... where has it gone? (i noticed that there is still a destructor in the flxState class that playstate is inheriting from)
I am also wondering what is the deal with garbage collection in Haxe, i have heard (the openfl people) whispers and a mention here and there on a forum or two that there is a GC and that it is reference counting objects and cleans them up when they become null or out of scope similarly to Java and c# but if that is the case why do you still have this FlxDestroyUtil object which is being used to destroy objects when your finished with them.
Along time ago at university i learned Java and in Java just like in haxe i see code like this "FlxG.switchState(new PlayState());" which is all fine and dandy in c# and Java but a big no no in Delphi or C++ unless the object itself has some sort of reference counter on it or has some sort of self destruct code as you no longer have a reference to it and thus will end up with a memory leak. I can except if there is a GC that when building to a CPP target that it is just "magic" that haxe got all of its memory cleaning correct in the right places.
importantly i really need to know how garbage collection and freeing memory works in haxe because if i make a game for ios and it gets reviewed by apple there is no way they will let some memory leaking garbage (one would hope) anywhere near the app store.. not only that though i try to make the best software i can and i take pride in what i develop. Leaky memory is very bad.
So given all of this can someone tell me, what is going on?