Details
-
Type: Bug
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: 3.0
-
Component/s: PicoContainer Scripting
-
Labels:None
-
Number of attachments :
Description
AbstractContainerBuilderContainerBuilder.killContainer() has the following code:
PicoContainer parent = container.getParent(); if (parent != null && parent instanceof MutablePicoContainer) { synchronized (parent) { ((MutablePicoContainer) parent).removeChildContainer(container); } }
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.