Bug 248387

Summary: Please fix dispose methods.
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: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