1

This question already has an answer here:

I know that we need to dispose of SPSite and SPWeb objects, especially in scenarios where we instantiate them or don't get them from context.

Other than these, which other objects in the SP Object Model should be disposed of?

Should we dispose of objects like SPFarm, SPWebServiceCollection, SPWebService, SPWebApplication, SPList, SPListItem, SPUser, SPGroup and so on? Or we need to dispose of only SPSite and SPWeb? This doesn't seem to be clearly documented. Please help.

Note: Though the below link talks about a few, it doesn't seem to be covering the list, which I have asked.

Can you provide a list of objects that needs to be disposed in SharePoint?

marked as duplicate by Robert Lindgren Aug 11 '16 at 11:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • The answers there do include all objects you should dispose, hence your question is not really relevant – Robert Lindgren Aug 11 '16 at 11:26
1

As a short answer regarding SPListobject.

`SPList` objects cannot be disposed

Not the answer you're looking for? Browse other questions tagged or ask your own question.