Skip to content

SO 27458124 When-do-you-use-scope-without-a-statement-in-c#

Notifications You must be signed in to change notification settings

nonnb/SO27458124-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Relating to Stack Overflow answer to When do you use scope without a statement in C#?

https://stackoverflow.com/a/27458173/314291

I was proven wrong - scope blocks inside methods have no effect on the GC collection lifespan of objects created within the scope.

  • In debug builds, all variables will be retained until method exit.
  • In release builds, any objects proven to have no further access will be eligible for collection at any point in the method

About

SO 27458124 When-do-you-use-scope-without-a-statement-in-c#

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages