From Wikipedia, the free encyclopedia
In computer programming, a weak reference is a reference that does not protect the referent object from collection by a garbage collector. An object referenced only by weak references is considered unreachable (or “weakly reachable”) and so may be collected at any time. Weak references are used to prevent circular references and to avoid keeping in memory referenced but unneeded objects. Many garbage-collected, object-oriented languages feature weak references, such as Java, Python, REALbasic, and ActionScript 3.0.