The “future implementations” said that lightweight object would be “just like objects but with no events just constructor and destructor methods”. Two weeks ago the text was edited and they removed the destructors part! So I guess ... NO! (but I really wish they do... unless they plan to reimplement data structures with OOP approach in the future)GML QUESTION:
Will there be destructors for the delete operator?
Sure you can also write:Code:function MyAlgorithm() { // constructor data = ds_map_create(); // destructor delete = function() { ds_map_delete(data); } } var alg = new MyAlgorithm(); delete alg;
Or wait for the garbage collector. But I personally prefer to just clean up and let the GC do as little work as possible.Code:var alg = new MyAlgorithm(); alg.delete(); delete alg;
by the way I asked the same exact question last week and there was no response from YYG either so I hope we have a response this time around.
Last edited: