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)- A6% (2)
- B83% (29)
- C3% (1)
- D9% (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.