Does all SPWeb or SPSite instances automatically disposed when console app process has ended?

Posted by Janis Veinbergs on Stack Overflow See other posts from Stack Overflow or by Janis Veinbergs
Published on 2010-05-14T08:38:53Z Indexed on 2010/05/14 8:44 UTC
Read the original article Hit count: 292

We have Best practices on using disposable object in SharePoint.

But i`m thinking - can I skip these when using Console Application? That's some code I want to execute once and after that process has finished. Do or don't SPSite and SPWeb's remain opened somwhere?

Why i`m asking this? I just don't want to stress when using something like

var lists =
  from web in site.AllWebs.Cast<SPWeb>()
  where web is meeting workspace && list is task list
  select list

then do some stuff on lists
etc.

Some serious resource leak there because webs get opened, filtered and NOT closed.

So should I worry in console app?

© Stack Overflow or respective owner

Related posts about sharepoint

Related posts about console-application