[picocontainer-scm] [jira] Created: (PICO-376) Kill Container Probably Won't Remove Child from Parent

"Michael Rimov (JIRA)" <jira-yCVjj/[email protected]> Tue, 30 Nov 2010 05:43:03 -0600 (CST)
Newsgroups gmane.comp.java.picocontainer.cvs
Message-ID <9989344.20802.1291117383275.JavaMail.haus-jira@codehaus01.managed.contegix.com>
Kill Container Probably Won't Remove Child from Parent
------------------------------------------------------

                 Key: PICO-376
                 URL: http://jira.codehaus.org/browse/PICO-376
             Project: PicoContainer
          Issue Type: Bug
          Components: PicoContainer Scripting
            Reporter: Michael Rimov
             Fix For: 3.0


AbstractContainerBuilderContainerBuilder.killContainer() has the following code:

{code}
        PicoContainer parent = container.getParent();
        if (parent != null && parent instanceof MutablePicoContainer) {
	    synchronized (parent) {
	          ((MutablePicoContainer) parent).removeChildContainer(container);
		}
        }

{code}

Only problem is we have a situation like this:

MutablePico parent = <blah>
MutablePico child = parent.makeChildContainer();

then containerBuilder.killContainer(child)  will NOT remove the child from the parent (possibly resulting in a memory leak. because parent will be an ImmutablePicoContainer.

I'll be checking in a test case that demonstrates this shortly.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

<hr/>
<p>
To unsubscribe from this list please visit:
</p>
<p>
    <a href="http://xircles.codehaus.org/manage_email">http://xircles.codehaus.org/manage_email</a>