To remove a given prefix or suffix, simply call the Remove method of the relevant
Affix object. In line with this, calling the Remove method of a given
Wrapper object will remove both of its affixes simultaneously.
Example Twenty-Two illustrates the former case by applying a single prefix, before calling the interceptee. The prefix is then removed,
meaning that a subsequent call to the interceptee results in its execution alone.
Critically, when an interceptee loses its affixes the interception mechanism for that interceptee disappears from the execution space,
meaning that the relationship between the interceptee and its owner object returns to normal (you pay only for what you use).
Note that removing an Affix object puts it into a state of limbo, wherein it cannot be re-attached to the
original (or any other) interceptee. This renders it useless thereafter in relation to AspectJS.
Bear in mind, however, that until all references to
the object expire, the memory that it occupies will not be recovered by the interpreter's garbage collector. Given this, references
to an Affix object that persist after its removal from an interceptee should be set to
null, or pointed at something else. Failure to do so
will consume memory unnecessarily (called in some circles, and incorrectly, a 'memory leak').
Do note also that the 'use once' characteristic of Affix objects may be relaxed in a future release of AspectJS.