Force Garbage Collection in AS3?

前端 未结 8 2010
轻奢々
轻奢々 2020-11-30 07:33

Is it possible to programmatically force a full garbage collection run in ActionScript 3.0?

Let\'s say I\'ve created a bunch of Display objects with eventListeners a

8条回答
  •  北海茫月
    2020-11-30 08:14

    If you have to, calling the gargabe collector could be useful... so, you have to be carefull how and when you do it, but there is no doubt that there are times when is neccesary.

    for example, if you have an app that is modular, when you change from one view to the other, all the deleted objects could represent a large amount of memory that should be available as faster as possible, you just need to have control of the variables and references you are disposing.

提交回复
热议问题