On Thu, Jan 23, 2014 at 12:06 PM, Gishu Pillai <gishu.pillai@...> wrote:
?
public Connection(SecureString password) {
? _myPassword = password.Copy(); // creates a clone of the password which needs to be disposed
}
public void Dispose()
{
? _myPassword.Dispose(); // releases any resources it holds
}
SecureString is a .Net framework type. I could wrap it in an adapter to ease testing...but doesn't solve the general problem. Wrapping all member disposable type with interfaces is going to be tedious.
It seems this is a better fit for Static code analysis.
Gishu
--
Thanks,
Roy Osherove
?? - ? ?- Read my new book
? ?- My blog for team leaders: ? ?- +47-96-90-22-15 (Oslo Time)