Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does AS3 have a class destructor?

My question is as simple as the title, yet googling it didn't give me a simple yes/no answer.

Does AS3 have a class destructor?

like image 285
zechdc Avatar asked Aug 14 '26 12:08

zechdc


1 Answers

In short: no, it doesn't. Flash Player virtual machine uses garbage collector concept. You don't have direct control over memory used by objects (except for rare cases like BitmapData.dispose() and ByteArray.clear()), but you are to do some work to make garbage collecting possible. And there is no way you can have something triggered automatically when an object dies.

Follow the links to learn more about GC logics.

like image 192
Michael Antipin Avatar answered Aug 17 '26 23:08

Michael Antipin