0
我使用Configuration.AppendListeners爲一些addional偵聽器。對於所謂的偵聽器,析構函數只在程序結束時調用 - 沒有額外的偵聽器,析構函數在System.GC.Collect上被調用。內存泄漏與addionatl NHibernate的聽衆?
廣告解決方法,我實現了IDisposable,我調用下面的方法:
private void CleanUpConfigurationListener()
{
if (configuration == null) return;
foreach (NHibernate.Event.ListenerType item in Enum.GetValues(typeof(NHibernate.Event.ListenerType)))
{
configuration.SetListener(item, null);
}
}
有了它,析構函數被再次調用。
這是內存泄漏嗎?
我使用NH 3.0因爲流利NHibernate(1.2)。
感謝您的回答。