comparison Implab/Safe.cs @ 1:6fb3b01ee971

Added utility class for safe disposing methods. Added event fireing while promise is cancelled (needs some more work)
author cin
date Tue, 27 Aug 2013 08:28:42 +0400
parents
children aa367305156b
comparison
equal deleted inserted replaced
0:279591fb4df3 1:6fb3b01ee971
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5
6 namespace Implab
7 {
8 public static class Safe
9 {
10 public static void Dispose<T>(ref T obj) where T : IDisposable
11 {
12 if (obj != null)
13 {
14 obj.Dispose();
15 obj = default(T);
16 }
17 }
18 }
19 }