| Summary: | [ActionSets] Actions associated with views not disposed | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Michael Fraenkel <fraenkel> | ||||
| Component: | UI | Assignee: | Douglas Pollock <douglas.pollock> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P1 | CC: | n.a.edgar | ||||
| Version: | 3.0 | ||||||
| Target Milestone: | 3.0.1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Michael Fraenkel
Created attachment 12546 [details]
Remove invisibleBars
Tagging for 3.0.1. Glancing at the patch, it doesn't look like removeActionSet will remove the entry from invisibleBars if it was found there. The removal was already being done in removeActionSet (line 83). But this is partly why I made the comment about cleaning up some of the code. I think some of the copying and management could be simplified. But that is separate from the current problem. Moving to the 3.0.1 milestone for consideration.... I have modified the patch slightly (rather than iterator two lists, it iterators over one larger list containing all items). I'm not entirely sure how to recreate the test case you give (i.e., it doesn't seem to work for me, though I'm not entirely convinced that I know what you mean by 'org.eclipse.debug.internal.ui.actions.DebugDropDownAction'). I would really appreciate it if you could test this fix when it becomes available. This patch has been reviewed by Kim, and is committed to the 3.1 and 3.0.1 branches. It should appear in I200408170800 and M200408180800. I have one minor concern that the clearActionSets method could be called in a situation where the invisible bars aren't meant to be disposed. WorkbenchWindow.updateActionSets is the possible culprit, but it only does if the active page is null. But, I don't believe this can ever happen. It works. However, I would have done some slight modifications like those
seen below. Nothing earth shattering or required.
Index: ActionPresentation.java
===================================================================
RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse
UI/org/eclipse/ui/internal/ActionPresentation.java,v
retrieving revision 1.14
diff -u -r1.14 ActionPresentation.java
--- ActionPresentation.java 13 Aug 2004 19:11:26 -0000 1.14
+++ ActionPresentation.java 13 Aug 2004 21:51:20 -0000
@@ -63,7 +63,7 @@
public void clearActionSets() {
// Get all of the action sets -- both visible and invisible.
List oldList = copyActionSets(mapDescToRec);
- oldList.addAll(copyActionSets(invisibleBars));
+ oldList.addAll(invisibleBars.keySet());
Iterator iter = oldList.iterator();
while (iter.hasNext()) {
@@ -78,10 +78,7 @@
private List copyActionSets(Map map) {
Set keys = map.keySet();
ArrayList list = new ArrayList(keys.size());
- Iterator iter = keys.iterator();
- while (iter.hasNext()) {
- list.add(iter.next());
- }
+ list.addAll(keys);
return list;
}
@@ -89,14 +86,11 @@
* Destroy an action set.
*/
public void removeActionSet(IActionSetDescriptor desc) {
- SetRec rec = (SetRec) mapDescToRec.get(desc);
+ SetRec rec = (SetRec) mapDescToRec.remove(desc);
if (rec == null) {
- rec = (SetRec) invisibleBars.get(desc);
+ rec = (SetRec) invisibleBars.remove(desc);
}
if (rec != null) {
- mapDescToRec.remove(desc);
- // Remove from the map that stores invisible bars
- invisibleBars.remove(desc);
IActionSet set = rec.set;
SubActionBars bars = rec.bars;
if (bars != null) {
For 3.0.1, I'm not going to make any further changes. For 3.1, I've taken your suggestions and gone one step further. I've removed "copyActionSets" entirely. Re comment #5, the active page is null if all perspectives are closed (e.g. Window > Close All Perspectives). Not sure if this case matters though. Michael: can you verify that the fix exists in M200408180800, and works as you'd like? Thanks. Its fixed in M200408180800. Just to clarify my test: 1. Create a new Workbench Window via Window -> New Window 2. Expose the Java Browsing Member View, Window -> Show View -> Other... -> Java Browsing -> Members 3. Switch to the Task View which has the Member View currently selected 4. Close the Workbench Window Verified by reporter. |