4
votes
3answers
378 views

An SPRequest object was not disposed - determine where this object was allocated

I have the SPRequest object was not disposed error. 12/10/2013 14:21:03.03 w3wp.exe (0x260C) 0x1700 SharePoint Foundation Performance nask ...
3
votes
3answers
128 views

What is the correct way of disposing these webs

I've been trying to find documentation on how to correctly dispose webs and sites and I've come across this article which is quite good, but doesn't seem to cover all my scenarios. My specific ...
2
votes
2answers
341 views

Dispose in Client Object Model

Should objects be disposed when using the client object model? If so, which ones? There seems to be plenty of information on this for server side, but nothing from Microsoft specifically about ...
1
vote
1answer
197 views

Implications of open SPWeb/SPSite

I have read in various places that un-disposed SPWeb/SPSite objects keeps valuable database connections open and large COM objects in memory. Not disposing those objects is like number one mistake ...
0
votes
2answers
2k views

best practice dispose parentWeb on feature activated, how to fix it in this scenario?

I am getting a warning from the spdisposecheck in one method I executed on the feature activated event. private void CopyAttendees(SPWeb currentWeb) { try { SPWeb parentWeb = ...
2
votes
4answers
518 views

What are the dangers of disposing of SPWeb when it's automatically disposed of?

In some cases such as: using (SPSite site = new SPSite(@"http://sitecollection/")) { SPWeb web = site.RootWeb; } you don't need to dispose of the SPWeb object because it is disposed of ...
2
votes
2answers
769 views

Dispose of SPItemEventProperties at the end of an event receiver?

Is there any need to call properties.Dispose(); at the end of an event receiver? Would this prevent memory leaks? Is this unnecessary? Is it best practice?
8
votes
2answers
2k views

SPWeb being closed when getting list by powershell. What's wrong?

When I run this little piece of powershell code: $w = Get-SPWeb http://localhost $l = $w.List["some list"] I get Unexpected error message to my Sharepoint ULS log Detected use of SPRequest for ...
2
votes
3answers
744 views

SPDispose false positive

I got many warnings from the SPDispose checker like this: ID: SPDisposeCheckID_140 Module: xx.xx.dll Method: xx.xx.Layouts.xx.UpdateWorkspace.Page_Load(System.Object,System.EventArgs) Statement: ...
2
votes
1answer
110 views

Will this code lead to an object not being disposed?

Say I have the following code: SPList promo1List = site.WebApplication.Sites[0].RootWeb.Lists.TryGetList("promotions"); Will this lead to the SPSite object Sites[0] not being disposed? I ran ...