I have an issue in my SharePoint environment and I suspect that this code causes a memory leak. I'm passing a SPWeb object as a value parameter.
Will the SPWeb object instance get disposed correctly using this code?
public void DoSomething(SPWeb web)
{
// code here
}
public void mainProgram()
{
using (SPWeb web = site.OpenWeb())
{
DoSomething(web);
//another code here
}
}