1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -1,20 +1,17 | |||||
1 | using System; |
|
1 | using System; | |
2 | using System.Collections.Generic; |
|
2 | using System.Collections.Generic; | |
3 | using System.Linq; |
|
3 | using System.Linq; | |
4 | using System.Text; |
|
4 | using System.Text; | |
5 |
|
5 | |||
6 | namespace Implab |
|
6 | namespace Implab | |
7 | { |
|
7 | { | |
8 | public static class Safe |
|
8 | public static class Safe | |
9 | { |
|
9 | { | |
10 |
public static void Dispose<T>( |
|
10 | public static void Dispose<T>(T obj) where T : class | |
11 | { |
|
11 | { | |
12 | var disp = obj as IDisposable; |
|
12 | var disp = obj as IDisposable; | |
13 | if (disp != null) |
|
13 | if (disp != null) | |
14 | { |
|
|||
15 | disp.Dispose(); |
|
14 | disp.Dispose(); | |
16 | obj = default(T); |
|
|||
17 | } |
|
|||
18 | } |
|
15 | } | |
19 | } |
|
16 | } | |
20 | } |
|
17 | } |
General Comments 0
You need to be logged in to leave comments.
Login now