Bug 248387 - Please fix dispose methods.
Summary: Please fix dispose methods.
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Mirko Paturzo CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-24 02:51 EDT by Soichiro Yoshimura CLA
Modified: 2021-07-05 11:40 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Soichiro Yoshimura CLA 2008-09-24 02:51:23 EDT
Build ID: I20080617-2000

Steps To Reproduce:
GridItem have a number of not garbage collected fields caused by cross references.

Please fix dispose method of GridItem.

GridItem dispose() line: 287-
:::::::::FROM:::::::::::

/**
     * {@inheritDoc}
     */
    public void dispose()
    {
        if (!parent.isDisposing())
        {
            parent.removeItem(this);
     
            if (parentItem != null)
            {
                parentItem.remove(this);
            }
            else
            {
                parent.removeRootItem(this);
            }
    
            for (int i = children.size() - 1; i >= 0; i--)
            {
                ((GridItem)children.get(i)).dispose();
            }
        }
        super.dispose();

:::::::::TO:::::::::::

   /**
     * {@inheritDoc}
     */
    public void dispose()
    {
        if (parent != null && !parent.isDisposing())
        {
            parent.removeItem(this);
     
            if (parentItem != null)
            {
                parentItem.remove(this);
                parentItem = null;
            }
            else
            {
                parent.removeRootItem(this);
            }

            {
	            for (int i = children.size() - 1; i >= 0; i--)
	            {
	                ((GridItem)children.get(i)).dispose();
	            }
	            
	            children.clear();
	            children = null;
            }
            
            {
            	backgrounds.clear();
            	backgrounds = null;
            	
            	foregrounds.clear();
            	foregrounds = null;
            	
            	grayeds.clear();
            	grayeds = null;
            	
            	checks.clear();
            	checks = null;
            	
            	checkable.clear();
            	checkable = null;
            	
            	columnSpans.clear();
            	columnSpans = null;
            	
            	images.clear();
            	images = null;
            	
            	texts.clear();
            	texts = null;
            	
            	tooltips.clear();
            	tooltips = null;
            }
            
            parent = null;
        }
        
        super.dispose();
    }


More information:
Comment 1 Thomas Schindl CLA 2009-03-04 10:49:07 EST
please create a patch against header_footer branch then I'll commit it
Comment 2 Thomas Schindl CLA 2009-04-24 09:56:40 EDT
still I'd prefer to get a patch from your side
Comment 3 Thomas Schindl CLA 2009-04-24 09:57:22 EDT
patch against HEAD please
Comment 5 Mirko Paturzo CLA 2014-02-10 07:57:48 EST
Improve dispose performance
Comment 6 Mirko Paturzo CLA 2014-02-10 10:44:04 EST
Test done and bug fixed