Force Garbage Collection in AS3?

前端 未结 8 2059
轻奢々
轻奢々 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:35

    As others said: do not try to GC manually, there are hacks but it's not safe.

    You should try recycling objects when you can - you'll save a lot of memory.

    This can be applied for instance to BitmapDatas (clear and reuse), particles (remove from display and reuse).

提交回复
热议问题