public class X_GC extends Object
OnGC annotation
allow objects to destroy each other without necessarily knowing anything about them.
It also allows forming "destruction chains", whereby when a root object is destroyed,
we can check if it's fields are destroyable and gc them too, either by annotating with OnGC,
or implementing the Destroyable interface.
Not that this may NOT be what you want, in case a field is shared among multiple children.
Thus, GC chaining is disabled by default.
Default behavior is to null out fields without inspecting them.| Modifier and Type | Method and Description |
|---|---|
static <T> void |
deepDestroy(Class<? super T> classLiteral,
T inst) |
static <T> void |
deepDestroy(Class<? super T> classLiteral,
T inst,
HashSet<Object> seen) |
static <T> void |
destroy(Class<? super T> classLiteral,
T inst)
In gwt, we can use this as a magic method to compute a destroy function,
but do so without bloating runtime code.
|
public static <T> void destroy(Class<? super T> classLiteral, T inst)
cls - inst - public static <T> void deepDestroy(Class<? super T> classLiteral, T inst)
Copyright © December 07, 2012–2015 The Internet Party. All rights reserved.