Skip to content
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

Deal with IDisposable message handlers that are per-instance #15

Open
tcabanski opened this issue Dec 26, 2011 · 1 comment
Open

Deal with IDisposable message handlers that are per-instance #15

tcabanski opened this issue Dec 26, 2011 · 1 comment

Comments

@tcabanski
Copy link
Contributor

Per-instance message handlers could also implement IDisposable. If they do, they have to be "released" when we are done with them. This is not the same as calling dispose directly (at least for most containers). Most IoC containers have some concept of Release. For example, Castle Windsor has an explicit release method. Some IoC container have the concept of a sub-container that calls IDispose for its components when it goes out of scope. This does have to be handled because, for at least Castle Windsor, this can cause memory leaks because in some cases the IoC container will hold onto the reference until the component is released or until the container itself is disposed.

@joefeser
Copy link
Member

joefeser commented Mar 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants