Skip to content

Instantly share code, notes, and snippets.

@bboyle1234
Created June 19, 2015 18:16
Show Gist options
  • Save bboyle1234/c6afee5f5bede2d986e6 to your computer and use it in GitHub Desktop.
Save bboyle1234/c6afee5f5bede2d986e6 to your computer and use it in GitHub Desktop.
DisposalTest
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ConsoleApplication1 {
class Program {
[STAThread]
static void Main(string[] args) {
Thread t = new Thread(Run);
t.Start();
Console.ReadKey();
}
static void Run() {
try {
using (var t = new Tester()) {
}
} catch (Exception x) {
int i = 0;
}
}
}
public class Tester : IDisposable {
StreamWriter sw;
public Tester() {
throw new Exception("hello world");
}
public void Dispose() {
if (null != sw)
sw.Dispose();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment