Skip to content

Instantly share code, notes, and snippets.

@tdshipley
Created June 1, 2016 16:00
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tdshipley/19fd523e51e163237d91335bf08c2556 to your computer and use it in GitHub Desktop.
Example of a using statement to ensure an object is garbage collected in C#
using (var file = File.OpenRead(CARD_ROOT_PATH + "card.raw"))
{
// Code which uses the file object
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment