That makes perfect sense.
In that case maybe from an API perspective we should support an overload on 
RemoveChildContainer, eg:
RemoveChildContainer(bool disposeContainer)

Cheers
John




________________________________
From: Krzysztof Koźmic <[email protected]>
To: [email protected]
Sent: Thu, 16 September, 2010 9:37:26 AM
Subject: Re: ReleaseComponent does not dispose service ?

The user can dispose the child container and doing so will detach the container 
from its parent.

The reason for that is, that you may want to still use the child after it's 
been 
detached from its parent, or potentially attach it to another parent, so 
Windsor 
makes no assumptions as to how lifetime of a container and hierarchy are 
coupled.

I'm not saying it's a good thing, just that's how it is. Parent container does 
not assume ownership of it's children.


2010/9/16 John Simons <[email protected]>

Krzysztof,
>
>So if I understand correctly you are saying that the user has to call Dispose 
>on 
>child container before calling RemoveChildContainer.
>
>Isn't this a bit counter-intuitive!
>
>Cheers
>John
>
>
>
>
________________________________
From: Xavier <[email protected]>
>To: Castle Project Users <[email protected]>
>Sent: Wed, 15 September, 2010 8:24:51 PM
>Subject: Re: ReleaseComponent does not dispose  service ?
>
>
>Great, it works ... and so obvious!
>As i told in my post "isn't it a best practice?" to call Dispose? Yes
>it is!
>
>Sorry about that.
>
>On Sep 15, 12:15 pm, Krzysztof Koźmic <[email protected]>
>wrote:
>> Dispose the child container
>>
>> sent from my HTC Desire
>>
>> On 15/09/2010 8:12 PM, "Xavier" <[email protected]> wrote:
>>
>> Well, it follows my previous post about RemoveChildContainer which
>> does not dispose its services ... Trying to find a workaround, i call
>> ReleaseComponent before removing the child container. But it seems
>> that it does not either call Dispose on services ?
>>
>> I don't really see any explanation for both problems: if i  release a
>> IDisposable service, it should be disposed (isn't it a best
>> practice ?). If i remove a child container, every services should be
>> released (and disposed).
>> In fact, it should react as if it was the main container, don't you
>> think so ?
>>
>> Thx
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Castle Project Users" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>>[email protected]<castle-project-users%[email protected]>
>>>
>> .
>> For more options, visit this group 
>>athttp://groups.google.com/group/castle-project-users?hl=en.
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"Castle Project Users" group.
>To post to this group, send email to [email protected].
>To unsubscribe from this group, send email to 
>[email protected].
>For more options, visit this group at 
>http://groups.google.com/group/castle-project-users?hl=en.
>
>
> 
>
-- 
>You received this message because you are subscribed to the Google Groups 
>"Castle Project Users" group.
>To post to this group, send email to [email protected].
>To unsubscribe from this group, send email to 
>[email protected].
>For more options, visit this group at 
>http://groups.google.com/group/castle-project-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.



      

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to