1
Vote

SharePoint Disposing Resources Problems

description

Hi !
While reading your code, i have seen some problems regarding SharePoint disposing, like that :
 
SPList membershipList = InitConnection();
try
{
...
foreach (string IndividualRole in RoleChoices.Choices)
{
   if (roleName.ToUpper() == IndividualRole.ToUpper())
      return true;
}
DisposeConnection();
return false;
}
catch (Exception e)
{
DisposeConnection();
throw new Exception("The method or operation RoleExists threw this error: " + e.Message);
}
 
If RoleExists, SharePoint resources are not disposed .. There's a lot of examples like this in your classes.
 
Besides, competitive access are not supported because you're initiating and closing connection on instance of class.
 
Regards;

comments