Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369416 - [databinding] MapSimpleValueObservableMap doesn't unhookListener from the native listner
Summary: [databinding] MapSimpleValueObservableMap doesn't unhookListener from the nat...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Matthew Hall CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-23 11:38 EST by Patrik Dufresne CLA
Modified: 2019-11-14 03:09 EST (History)
1 user (show)

See Also:


Attachments
Fix with unit test (3.16 KB, patch)
2012-01-23 18:57 EST, Matthew Hall CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.