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

Bug 369416

Summary: [databinding] MapSimpleValueObservableMap doesn't unhookListener from the native listner
Product: [Eclipse Project] Platform Reporter: Patrik Dufresne <ikus060>
Component: UIAssignee: Matthew Hall <qualidafial>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen
Version: 4.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Attachments:
Description Flags
Fix with unit test none

Description Patrik Dufresne CLA 2012-01-23 11:38:59 EST
Build Identifier: 

During the disposal phase of the MapSimpleValueObservableMap, the observable map doesn't call the INativeListener.removeFrom(Object). According to my research, the variable knownMasterValues is set to null by lastListenerRemoved() before getting cleared.

To properly fix it, when the last listener get removed, the content of knownMasterValues should be cleared as followed :

	protected void lastListenerRemoved() {
		masterMap.removeMapChangeListener(masterListener);
		masterMap.removeStaleListener(staleListener);
		if (knownMasterValues != null) {
			knownMasterValues.clear(); // detaches listeners
			knownMasterValues.dispose();
			knownMasterValues = null;
		}
		cachedValues.clear();
		cachedValues = null;
		staleMasterValues.clear();
		staleMasterValues = null;
	} 

Reproducible: Always
Comment 1 Matthew Hall CLA 2012-01-23 15:24:09 EST
Investigating.
Comment 2 Matthew Hall CLA 2012-01-23 18:57:26 EST
Created attachment 209949 [details]
Fix with unit test
Comment 3 Lars Vogel CLA 2019-11-14 03:09:45 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.