0

I'm having a hard time managing my memory in flash lite. are there any pointers i should care about ? or best practices?

ive been reading every 60 seconds the garbage collector runs.

i'm deleting my objects/movieclips like

mc = null; delete mc;

and making sure every listeners is deleted on it.

still nothing seems to happen..

4

1 回答 1

2

Flash 的垃圾收集器不是确定性的——它在可以运行时运行,虽然它可能会检查它是否可以定期运行,但不能保证它会运行。如果您的 SWF 一直在消耗 CPU,则 GC 将永远没有时间运行。

Flash Lite 使用 ActionScript 2,它确实有一个用于视觉资产的“nuke”选项 - MovieClip.unloadMovie()。如果你有一个movieclip,在它上面运行unload 会杀死它里面的所有东西。

于 2009-07-02T15:14:56.700 回答