Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322123 - [Viewers] org.eclipse.jface.viewers.TreeColumnViewerLabelProvider should call dispose of passed IBaseLabelProvider
Summary: [Viewers] org.eclipse.jface.viewers.TreeColumnViewerLabelProvider should call...
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Hitesh CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-09 07:20 EDT by Sushant Sirsikar CLA
Modified: 2010-08-23 01:46 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sushant Sirsikar CLA 2010-08-09 07:20:53 EDT
Build Identifier: M20090211-1700

When we create instance of org.eclipse.jface.viewers.TreeColumnViewerLabelProvider, we pass IBaseLabelProvider instance in it’s constructor. Please look following code snippet.

public class TreeColumnViewerLabelProvider extends
		TableColumnViewerLabelProvider {
         …
	 …
         ...

         /**
	 * Create a new instance of the receiver with the supplied labelProvider.
	 * 
	 * @param labelProvider
	 */
	public TreeColumnViewerLabelProvider(IBaseLabelProvider labelProvider) {
		super(labelProvider);
	}  
     ....
     .....
     ....... 
}

When dispose method of TreeColumnViewerLableProvider is called, then dispose method of passed IBaseLabelProvider should be called automatically. Dispose method of IBaseLabelProvider can contain cleanup code (e.g. Image  object cleanup, etc)  which might be very important for memory management.  As current implementation doesn’t call dispose method of IBaseLabelProvider, all clean up code written into that becomes redundant.


Reproducible: Always
Comment 1 Remy Suen CLA 2010-08-09 08:05:15 EDT
You can workaround the code by disposing the label provider manually when needed.
Comment 2 Thomas Schindl CLA 2010-08-09 10:10:43 EDT
Does the LabelProvider API-Doc say that it is illegal to attach the same instance to multiple columns? If the answer is NO we can't simply call dispose :-(
Comment 3 Hitesh CLA 2010-08-19 08:52:25 EDT
Considering comment #1 and comment #2, updating severity to a realistic value.
Comment 4 Hitesh CLA 2010-08-19 08:56:36 EDT
In fact considering Toms comment, and the fact that you can sub class TreeColumnViewerLabelProvider to override dispose, I would say this is an not a bug. I intend to mark it as INVALID.
Comment 5 Hitesh CLA 2010-08-23 01:46:11 EDT
Marking as INVALID. Read comments above.