should we create a ticket then? 

also i'm using child containers to implement windsor support for 
Simple.Web, is this the correct approach? 

https://github.com/mickdelaney/Simple.Web/blob/master/src/Simple.Web.Windsor/WindsorSimpleContainerScope.cs




On Thursday, June 6, 2013 12:02:33 AM UTC+1, Krzysztof Koźmic wrote:
>
> That's probably a bug
>
> Krzysztof
>
> sent from my phone
> On 06/06/2013 8:51 AM, "Michael Delaney" <[email protected] <javascript:>> 
> wrote:
>
>> getting the same problem also. 
>>
>> On Wednesday, 24 April 2013 02:17:43 UTC+1, ABloo Bloo wrote:
>>>
>>> For some context, I'm working with Windsor and asp.net webapi.  There's 
>>> a webapicontrib project that provides what is effectively a 
>>> controllerfactory (in this case an IDependencyResolver) that is implements 
>>> its scopes by using a child container. Specifically, each request is 
>>> handled by a child container that is then disposed at the end of the 
>>> request.  All my registrations are done at the parent level.
>>>
>>> Now, onto the problem.
>>>
>>> What I was expecting is that once the child container was disposed, all 
>>> the transient components that were resolved via that container would be 
>>> disposed as well (if my controller had some dependencies that were 
>>> IDisposable I would expect them to get disposed).  In fact, nothing gets 
>>> disposed.  If I debug, I see that the components are actually listed under 
>>> the _parent's_ "Objects tracked by release policy" and nothing is tracked 
>>> at the child level at all.  Since the parent scope lives for the life of 
>>> the app, those bits are never cleaned up.
>>>
>>> Am I misunderstanding how child containers are supposed to work?
>>>
>>> Here's a very brief sample.  "Disposed" is never printed.
>>>
>>> interface ITest
>>>     {        
>>>     }
>>>
>>>     class Tester : ITest, IDisposable
>>>     {
>>>         public Tester()
>>>         {
>>>             Console.WriteLine("Created");
>>>         }
>>>      
>>>         public void Dispose()
>>>         {
>>>             Console.WriteLine("Disposed");
>>>         }
>>>     }
>>>
>>>     class Program
>>>     {
>>>         static void Main(string[] args)
>>>         {
>>>             var parent = new WindsorContainer();
>>>             parent.Register(Component.For<**
>>> ITest>().ImplementedBy<Tester>**().LifestyleTransient());
>>>
>>>             var child = new WindsorContainer();
>>>             parent.AddChildContainer(**child);
>>>
>>>             var i = child.Resolve<ITest>();
>>>
>>>             child.Dispose();
>>>
>>>             Console.WriteLine("Done");
>>>             Console.ReadLine();
>>>         }
>>>     }
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Castle Project Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to 
>> [email protected]<javascript:>
>> .
>> Visit this group at 
>> http://groups.google.com/group/castle-project-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>

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


Reply via email to