nerdexam
Microsoft

70-573 · Question #224

You have a Web application that contains the following code segment. Private Sub CreatingSPSite() Dim siteCollection As SPSite = Nothing Try Finally End Try End Sub You need to prevent the code…

The correct answer is B. if (siteCollection != null). MNEMONIC RULE: "Dispose of memory leak" Difference between Close() and Dispose() Method

Developing SharePoint Solutions

Question

You have a Web application that contains the following code segment. Private Sub CreatingSPSite() Dim siteCollection As SPSite = Nothing Try Finally End Try End Sub You need to prevent the code segment from causing a memory leak. Which code segment should you add?

Options

  • Aif (siteCollection != null)
  • Bif (siteCollection != null)
  • CsiteCollection = null;
  • DsiteCollection.WriteLocked = false;

How the community answered

(35 responses)
  • A
    6% (2)
  • B
    83% (29)
  • C
    3% (1)
  • D
    9% (3)

Explanation

MNEMONIC RULE: "Dispose of memory leak" Difference between Close() and Dispose() Method

Topics

#memory management#SPSite disposal#IDisposable#resource management

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice