The fix for this sort of problem is simple: null out references once they become obsolete.