Tagged Questions
1
vote
2answers
77 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
72 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
844 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
356 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
458 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
1k 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
540 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
90 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 ...