Posted by: joachimvandenbogaert | October 3, 2007

Regarding releasing resources

I read something very useful: apparently the “using” statement is an exception to the non-deterministic destruction behaviour in C#. Normally, when a variable goes out of scope, it will be collected at some point in the future by the Garbage Collector. The “using” statement makes sure that all objects that implement the IDisposable interface are being cleared up immediately after the “using” block exits.

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

Categories

%d bloggers like this: