Pārlūkot izejas kodu

2004-03-08 Zoltan Varga <[email protected]>

	* Timer.cs (Dispose): Applied patch from Jaroslaw Kowalski
	([email protected]). Fix finalization problems during appdomain unload.

svn path=/trunk/mcs/; revision=23807
Zoltan Varga 22 gadi atpakaļ
vecāks
revīzija
372e2b3af8

+ 5 - 0
mcs/class/corlib/System.Threading/ChangeLog

@@ -1,3 +1,8 @@
+2004-03-08  Zoltan Varga  <[email protected]>
+
+	* Timer.cs (Dispose): Applied patch from Jaroslaw Kowalski 
+	([email protected]). Fix finalization problems during appdomain unload.
+
 2004-02-23  Jackson Harper <[email protected]>
 
 	* LockCookie.cs: Add some fields for restoring locks.

+ 8 - 8
mcs/class/corlib/System.Threading/Timer.cs

@@ -111,15 +111,15 @@ namespace System.Threading
 			void Dispose (bool disposing)
 			{
 				disposed = true;
-				if (wait != null) {
-					wait.Set ();
-					Thread.Sleep (100);
-					((IDisposable) wait).Dispose ();
-					wait = null;
-				}
-
-				if (disposing)
+				if (disposing) {
+					if (wait != null) {
+						wait.Set ();
+						Thread.Sleep (100);
+						((IDisposable) wait).Dispose ();
+						wait = null;
+					}
 					GC.SuppressFinalize (this);
+				}
 			}
 
 			~Runner ()