Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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 client side.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

There is no need to dispose of objects using the Client Object Model with JavaScript because it handles the memory management for you. For more information on JavaScript memory management check out this article: https://developer.mozilla.org/en-US/docs/JavaScript/Memory_Management

share|improve this answer
    
Should have been more specific - I am curious about all 3 client APIs - but mostly wondering about the .NET Managed Client Object Model. –  drquinn Mar 23 '13 at 1:03
1  
None of the APIs require memory management because it must already be handled on the other end to support JavaScript. As you can see in the examples here msdn.microsoft.com/en-us/library/ee857094(v=office.14).aspx there is no use of dispose. –  Ryan Erickson Mar 23 '13 at 1:06
    
I noticed that none of the MSDN examples used dispose. Just curious if they left it out for simplicity, but still required for larger operations. Thanks! –  drquinn Mar 25 '13 at 18:23
    
This is incorrect some objects do need disposing due to asynchronous behavior. –  Hugh Wood Feb 17 at 9:32

There is no need to dispose of objects in the managed client object model, as there are no unmanaged resources in use, everything is cleaned up by the garbage collector.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.