创建一个弱引用对象 [英] Create a weak reference to an object

查看:260
本文介绍了创建一个弱引用对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在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.

这篇关于创建一个弱引用对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆