diff Implab/Components/Disposable.cs @ 213:9ee78a345738 v2

Minor code changes
author cin
date Tue, 11 Apr 2017 01:35:18 +0300
parents 7d07503621fe
children 9f63dade3a40
line wrap: on
line diff
--- a/Implab/Components/Disposable.cs	Tue Apr 04 12:04:05 2017 +0300
+++ b/Implab/Components/Disposable.cs	Tue Apr 11 01:35:18 2017 +0300
@@ -8,7 +8,7 @@
     /// Base class the objects which support disposing.
     /// </summary>
     public class Disposable : IDisposable {
-        
+
         int m_disposed;
 
         public event EventHandler Disposed;
@@ -75,11 +75,9 @@
         /// из нескольких потоков.
         /// </remarks>
         protected virtual void Dispose(bool disposing) {
-            if (disposing) {
-                EventHandler temp = Disposed;
-                if (temp != null)
-                    temp(this, EventArgs.Empty);
-            }
+            if (disposing)
+                Disposed.DispatchEvent(this, EventArgs.Empty);
+
         }
 
         [SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly", Justification = "Dipose(bool) and GC.SuppessFinalize are called")]