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

Bug 315261

Summary: [Compatibility] Event handlers and part references can be leaked if the backing part was never initialized
Product: [Eclipse Project] e4 Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Remy Suen <remy.suen>
Status: RESOLVED FIXED QA Contact: Remy Suen <remy.suen>
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: 4.1 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Part reference destruction patch v1 none

Description Remy Suen CLA 2010-06-01 13:31:31 EDT
In order to construct a 3.x part, we need the EditorReference/ViewReference because it contains much needed information required to instantiate the part in question (such as the IConfigurationElement). We use an event handler to set the reference into the context when a part's context has been set but if the part is just closed, the part reference needs to go and so does the event handler. At the moment, this doesn't happen. When the part is reopened later, there are now two event handlers. It seems the right one gets the last "set" called on the context so it works but this is still a bug nonetheless.
Comment 1 Remy Suen CLA 2010-11-26 09:52:13 EST
Due to the changes for bug 315133, we are no longer creating multiple references/event handlers. The reference itself is still lingering if an uninitialized part is closed though.
Comment 2 Remy Suen CLA 2010-11-26 12:46:03 EST
Created attachment 183944 [details]
Part reference destruction patch v1
Comment 3 Remy Suen CLA 2010-11-26 12:47:25 EST
Fixed in CVS HEAD.