Do you think you know when to call Dispose() in Sharepoint ?

 
One of the most frequent cause of problems in Sharepoint developement is when developers don’t call Dispose() (specially when they traverse collections of objects).
My reference for this was this excellent whitepaper from Scott Harris and Mike Ammerlaan ; to summarize, call Dispose() all the time except when the object comes from the context (ex SPContext.Web), because Sharepoint will take care of it.
However the following article from Roger Lamb shows that it is a bit more complex.
 
 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s