// destroy all upward references to let the garbage collection take care of the rest public void Dispose() { if (effectHandler == null) { return; } effectHandler.RemoveEffect(this); effectHandler = null; }
public void SetEffectHandler(EffectHandlers.BaseEffectHandler value) { lock (changeLock) { if (effectHandler == value) { return; } if (effectHandler != null) { effectHandler.RemoveEffect(this); } effectHandler = value; value.AddEffect(this); } }