Articles tagged with: SPDisposeCheck

Oct26

When and what dispose

Written by // Rogério Cruzeiro Categories // Brain Dump

Avoiding memory leaks general rules:

  1. Use SPDisposeCheck utility to identify issues (very usefully on analysing 3rd party code)

  2. Dispose when:
    1. Enumeration AllWebs or Webs
    2. OpenWeb()
    3. Anytime the new command is used

  3. Don't dispose when:
    1. ParentWeb
    2. RootWeb
    3. SPContext