| Summary: | Leak caused by SaveablesList.removeModel | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Dani Megert <daniel_megert> |
| Component: | UI | Assignee: | Boris Bokowski <bokowski> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | critical | ||
| Priority: | P3 | CC: | Olivier_Thomann |
| Version: | 3.3 | ||
| Target Milestone: | 3.3 M5 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
The build id is I20070110-1600 and not I20070110-1800. Boris, see bug 170184 for details why removeModel got called twice. I committed a workaround in Platform Text that takes the current life-cycle as outlined in bug 170184 into account. Fix released >20070111. |
I20070110-1800 1. open a text editor 2. close the text editor ==> editor instance still there (leaked) Repeating step 1 and 2 leaks an additional editor each time. REASON: the code in SaveablesList.removeModel is wrong (looks like copy/paste error of code copied from addModel): boolean result = false; Set modelsForSource = (Set) modelMap.get(source); if (modelsForSource == null) { !BAD> modelsForSource = new HashSet(); <-- BAD! !BAD> modelMap.put(source, modelsForSource); <-- BAD! } if (modelsForSource.remove(model)) { result = decrementRefCount(modelRefCounts, model); if (modelsForSource.isEmpty()) { modelMap.remove(source); } } return result;