Bug 248386

Summary: GridTableViewer has a memory leak problem by cross-reference.
Product: z_Archived Reporter: Soichiro Yoshimura <soichiro.yoshimura>
Component: NebulaAssignee: Mirko Paturzo <caosmpz>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: caosmpz, hidenobu.shinozuka, makoto.tsushima, soichiro.yoshimura, tom.schindl, wim.jongman
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Soichiro Yoshimura CLA 2008-09-24 02:41:39 EDT
Build ID: I20080617-2000

Steps To Reproduce:
GridTableViewer have two not garbage collected fields.

  cachedRow
  rowHeaderLabelProvider

these fields were cross referenced.

More information:
Please add this orverride method if there are no problem.

/**
 * @see org.eclipse.jface.viewers.StructuredViewer#handleDispose(org.eclipse.swt.events.DisposeEvent)
 */
protected void handleDispose(DisposeEvent event)
{
	super.handleDispose(event);
	
	this.cachedRow = null;
	this.rowHeaderLabelProvider = null;
}
Comment 1 Mirko Paturzo CLA 2014-02-06 14:42:37 EST
Hi all,
in my patch, i have change the method with:

    @Override	
    protected void handleDispose(final DisposeEvent event)
    {	
        super.handleDispose(event);
        cachedRow = null;
        rowHeaderLabelProvider = null;

        getGrid().setRedraw(false);	
        getGrid().disposeAllItems();	
        getGrid().clearItems();
    }

I'll do some tests for verify if there is a memory leak

Mirko
Comment 2 Mirko Paturzo CLA 2014-02-10 08:07:09 EST
Pa
Comment 3 Mirko Paturzo CLA 2014-02-10 08:07:53 EST
Improve dispose performace and create a snippet test.
Comment 4 Mirko Paturzo CLA 2014-02-10 10:43:30 EST
Test done and bug fixed