Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328095

Summary: remove DelegatingEventSource as OnChangeEvictingCache.Listener
Product: [Modeling] TMF Reporter: Knut Wannheden <knut.wannheden>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: 2.0.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Knut Wannheden CLA 2010-10-19 02:43:36 EDT
Looking at the code for DelegatingEventSource I get the impression that it should in onEvict() in addition to removing itself as a listener to IResourceDescription.Event.Source also remove itself as a listener to the OnChangeEvictingCache. Otherwise it will remain and it also has references to IContainers which then can't be garbage collected. Did I miss something?
Comment 1 Sebastian Zarnekow CLA 2010-10-19 03:07:31 EDT
The cache listener serve as a helper to notify a cached value about the fact that it is no longer cached and thereby no longer valid. That's why they only work once and will be removed as a listener from the cache when the cache is evicted (see CacheAdapter). They deserve a better name - any suggestions?

Did you experience any leaking containers?
Comment 2 Knut Wannheden CLA 2010-10-19 03:27:47 EDT
No, I am just trying to understand how some things fit together. And this interaction between IResourceDescripions, IGlobalScopeProvider, and IContainer seems a bit tricky.

I missed the part where the cache itself removes all attached listeners.