Developping for the translation industry RSS 2.0



 Wednesday, 21 May 2008

At my company, we have a windows service, built in C#, that makes automatic modifications to Active Directory groups. This process use the function call “FindAll()” from the System.DirectoryServices.DirectorySearcher class.

It seems that the SearchResultCollection returned by the FindAll method can’t release it’s unmanaged resources by itself, so you need to call explicitly the Dispose() method.

From MSDN:

Due to implementation restrictions, the SearchResultCollection class cannot release all of its unmanaged resources when it is garbage collected. To prevent a memory leak, you must call the Dispose method when the SearchResultCollection object is no longer needed.

 

Wednesday, 21 May 2008 14:54:00 (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
.NET
Comments are closed.

Navigation
Advertisement
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2018
Stanislas Biron
Sign In
Statistics
Total Posts: 135
This Year: 0
This Month: 0
This Week: 0
Comments: 1
All Content © 2018, Stanislas Biron