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

Bug 364154

Summary: [Commands] Memory Leak in WorkbenchSourceProvider via context variable "activeEditorInput"
Product: [Eclipse Project] Platform Reporter: Joachim Hoessler <hoessler>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P5 CC: gautier.desaintmartinlacaze, remy.suen
Version: 3.7.1Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Joachim Hoessler CLA 2011-11-18 09:16:38 EST
Build Identifier:  M20110909-1335

Upon closing an editor, nearly all variables in the EvaluationContext get cleared, but not "activeEditorInput" - it still holds a reference to the last EditorInput, causing a leak. 

I think this is caused by a missing default entry in the hashmap for "activeEditorInput" in WorkbenchSourceProvider.updateActivaPart(Map currentState, boolean updateShowInSelection). 

Reproducible: Always

Steps to Reproduce:
1. Open one single editor
2. Close the editor
3. "activeEditorInput" variable isn't cleared
Comment 1 Paul Webster CLA 2011-11-18 09:55:40 EST
A leak of what?  IEditorInputs are light-weight objects.

It should still be cleared if activeEditor is clear, I think.

PW
Comment 2 Joachim Hoessler CLA 2011-11-18 10:02:13 EST
(In reply to comment #1)
> A leak of what?  IEditorInputs are light-weight objects.

Well, we're using org.eclipse.compare.CompareEditorInput as Input and that doesn't really look like a light-weight object.

Additionally, I think the variable should get cleared because otherwise an evaluation of the context could yield wrong results.
Comment 3 Eclipse Genie CLA 2020-04-28 19:12:47 EDT
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.

--
The automated Eclipse Genie.