All,

when a container is disposed it typically invokes the 
dispose() method of all its disposable components.

If a component has held on to a reference obtained 
via lookup(), is it safe to release it?

If we have the following situation:

Component A is contained in Container C. Container C
is a child of container P. Thus, A can look up components
in P. (Think parent component manager).

A obtains a component X via a ComponentManager interface.

X is contained in P.

C is disposed, and calls A.dispose().

A now releases X.

The question: is it guaranteed that X will be released back
to P?

I would go for a "yes" and if this is not the case, make it
part of the contract.

/LS

Reply via email to