Project: Eclipse_Platform_UI
Bug 158204 [Decorators] DecorationScheduler hangs on to listeners for too long
Reported: 2006-09-21 15:19:37 | Status: verified fixed

3.2 I have a case where an editor I'm implementing is not freed up properly when closed. In YourKit, it shows that it's being held onto via a label provider changed listener hooked on the decorator manager. In DecorationScheduler, it grabs the array of listeners from the manager, then iterates over them in the update job. At the end, though, it's left hanging on to the original array of listeners. The array should get nulled out at the end to drop these references. Suggested patch is to replace: labelProviderChangedEvent = null; removedListeners.clear(); with: labelProviderChangedEvent = null; removedListeners.clear(); listeners = null; in getUpdateJob() Also noticed a possible optimization: DecoratorManager.getListeners() does not need to take a copy of the array from listeners.getListeners(), since this is spec'ed to not be affected by subsequent add/removes.

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationScheduler.java