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

Bug 287471

Summary: [ActionSets] Actionsets leak when opening/closing perspectives
Product: [Eclipse Project] Platform Reporter: Paul Webster <pwebster>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, hokamoto, Matthew_Hatem, raji
Version: 3.4.2   
Target Milestone: 3.6 M2   
Hardware: PC   
OS: All   
Whiteboard:
Bug Depends on: 273495    
Bug Blocks:    

Description Paul Webster CLA 2009-08-24 14:54:43 EDT
+++ This bug was initially created as a clone of Bug #273495 +++

Created an attachment (id=132996)
possible patch

Build ID: 3.4.2.M20090127-1700

Steps To Reproduce:
Create a new plugin project using the RCP Mail Template
  - Add an actionSet extension, I used the "Hello, World" action set template
  Run example application
  
  - Edit OpenViewAction.run change to
  if(window != null) {	
			try {
				window.getWorkbench().showPerspective("cbg.perf.example.rcp2.perspective", window);
				Thread.sleep(500);
		    	IWorkbenchPage page = window.getActivePage();
		    	if(page == null) return;
		    	page.closePerspective(page.getPerspective(), false, true);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
			
  I added a conditional breakpoint at the bottom of the ReferenceHashSet.add(Object,int) method
  The condition is:
  if(referenceType == 0 && values.length > 8)
    System.out.println("RHS + " + System.identityHashCode(this) + " " + elementSize);
  return false;
  I'm using the conditional breakpoint to demonstrate that each time I open/close the perspective a strong reference is added to the ReferenceHashSet but not removed.
  
  Run the application and press the "plus" action.
  
  I can attach my example project if that's preferable.
  
  This patch fixes the problem for me, does this look reasonable?

More information:
Comment 1 Paul Webster CLA 2009-08-24 14:56:48 EDT
bug 273495 attachment (id=139577)
Comment 2 Paul Webster CLA 2009-08-24 15:21:37 EDT
(In reply to comment #1)
> bug 273495 attachment (id=139577) [details]
> 

Released to HEAD >20090824
PW
Comment 3 Paul Webster CLA 2009-09-15 14:36:36 EDT
In I20090915-0100
PW