Skip to content

Instantly share code, notes, and snippets.

Created June 4, 2015 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/ea19c1dcbd576dba4c63 to your computer and use it in GitHub Desktop.
Save anonymous/ea19c1dcbd576dba4c63 to your computer and use it in GitHub Desktop.
public class Program
{
public static void Main()
{
object o = new object();
WeakReference r = new WeakReference(o);
GC.Collect();
Console.WriteLine("Still alive? {0}", r.IsAlive ? "yes" : "no");
Console.ReadLine();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment