comparison Implab/Safe.cs @ 221:8808383fcb94 v2

fixed recursion in Safe.Dispose with IEnumerable
author cin
date Fri, 23 Jun 2017 01:03:42 +0300
parents fe5101083150
children 6fa235c5a760
comparison
equal deleted inserted replaced
220:42814145d472 221:8808383fcb94
77 77
78 public static void Dispose(object obj) { 78 public static void Dispose(object obj) {
79 if (obj is IDisposable) { 79 if (obj is IDisposable) {
80 Dispose((IDisposable)obj); 80 Dispose((IDisposable)obj);
81 } else if (obj is IEnumerable) { 81 } else if (obj is IEnumerable) {
82 Dispose((IEnumerable)obj); 82 DisposeCollection((IEnumerable)obj);
83 } 83 }
84 } 84 }
85 85
86 [DebuggerStepThrough] 86 [DebuggerStepThrough]
87 public static void DispatchEvent<T>(this EventHandler<T> handler, object sender, T args) { 87 public static void DispatchEvent<T>(this EventHandler<T> handler, object sender, T args) {