-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typed factory should allow disposing multiple times #458
Comments
Is this causing you a problem in your code? Are you not using Windsor to control the lifetime of your factories? I suspect it was done this way to make sure Windsor was always cleaning up neatly, no reason the facility should call Dispose more than once. |
I'm using transient lifestyle factories in some of my ViewModels. For example, to add a to a collection of child ViewModels. |
Are you calling |
The factory is resolved as a dependency, I do not care about releasing it. I don't understand where you are getting at @jonorossi , using the |
Are you calling |
"Whatever you explicitly resolve, you should also explicitly release." |
I don't follow, you said "The factory is resolved as a dependency" therefore it is not explicitly resolved, so you should not explicitly release. |
The |
OK, a very similar case here: I have a singleton factory, so dependent components explicitly call Therefore, I'd say that not only the second call to I can make a PR with the changes and some tests if needed. |
I just fell into this and it looks like no progress has been made on this one. Following the documentation about the I have a component that implements Reviewing the stack trace the exception happens when I've called Playing with lifestyles I can confirm that If the component that uses the factory is I've got to do some further work checking behaviour under WCF as the component in this case is the service implementation which will be This all said throwing an exception from a
|
@ivan-danilov makes sense. I think I was misunderstanding the situation like @mjacobs80 also has:
|
According to .NET Guidelines a dispose method should tolerate being called multiple times without throwing an exception.
This exception should not be thrown when
method
equalsFactoryMethod.Dispose
:Windsor/src/Castle.Windsor/Facilities/TypedFactory/Internal/TypedFactoryInterceptor.cs
Line 55 in 603d78d
The text was updated successfully, but these errors were encountered: