0

我正在调查 Windsor 以设置 IoC 容器。

我浏览了教程,它说我必须将 WindsorControllerFactory 注册为 DefaultControllerFactory 才能让事情顺利进行。该部分还详细说明了它的工作是:1)向 MVC 运行时提供实例,2)然后释放控制器。

我的问题是,DefaultControllerFactory 的默认实现不提供这些任务来提供控制器实例并释放它们吗?

4

1 回答 1

0

MVC's DefaultControllerFactory disposes the created controller, but that is not the same as releasing them. Castle Windsor will keep a reference to a created instance until you tell Windsor you are done with it. So not explicitly calling release on a controller will cause a memory leak.

于 2013-09-19T12:46:38.783 回答