创建一个弱引用对象创建一个、对象

由网友(落花い是逝去的蝶)分享简介:是否有可能在ActionScript 3中创建一个弱引用的对象,因此它可以被垃圾回收。Is it possible in Actionscript 3 to create a weak reference to an object, so that it can be garbage collected.我创建了一...

是否有可能在ActionScript 3中创建一个弱引用的对象,因此它可以被垃圾回收。

Is it possible in Actionscript 3 to create a weak reference to an object, so that it can be garbage collected.

我创建了一些类,使调试变得更容易,所以我不希望对象流连在内存中,如果他们只在这里引用的(当然我不希望填补了code与回调删除对象)

I'm creating some classes to make debugging easier, so I don't want the objects to hang around in memory if they are only referenced here (and of course I don't want to fill the code with callbacks to remove the objects)

推荐答案

格兰特斯金纳写了一个极好的一系列有关的在ActionScript 3 资源管理,并且在一系列他介绍的中的WeakReference和WeakProxyReference 助手类,可用于此目的。

Grant Skinner has written an excellent series of articles on resource management in ActionScript 3, and in the third part of that series he introduces the WeakReference and the WeakProxyReference helper classes that can be used for this.

阅读全文

相关推荐

最新文章