[Mono-bugs] [Bug 75068][Nor] New - Timer.Close() does NOT set Timer.Enabled = false;

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri May 27 14:11:59 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by schaf at sheepsworld.com.

http://bugzilla.ximian.com/show_bug.cgi?id=75068

--- shadow/75068	2005-05-27 14:11:59.000000000 -0400
+++ shadow/75068.tmp.26036	2005-05-27 14:11:59.000000000 -0400
@@ -0,0 +1,64 @@
+Bug#: 75068
+Product: Mono: Class Libraries
+Version: 1.0
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: schaf at sheepsworld.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Timer.Close() does NOT set Timer.Enabled = false;
+
+Description of Problem:
+Timer.Close() or StopTimer() do not set Timer.Enabled = false;
+Thats definitly wrong, ms does set Timer.Enabled = false;
+
+
+Steps to reproduce the problem:
+1. try this with windows and mono:
+namespace timertestcase
+{
+	class MainClass
+	{
+		static System.Timers.Timer timer;
+		
+		public static void Main(string[] args)
+		{
+			timer = new System.Timers.Timer();
+			
+			timer.Interval = 1000;
+			timer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimer);
+			timer.Start();
+			while(Console.ReadLine()!="q") {}
+		}
+		
+		public static void OnTimer(Object source, System.Timers.ElapsedEventArgs e)
+		{
+			timer.Close();
+			Console.WriteLine("timer.enabled should be False, it is
+"+timer.Enabled.ToString());
+		}
+	}
+}
+
+Actual Results:
+mono: timer.enabled should be False, it is True
+windows: timer.enabled should be False, it is False
+
+
+Expected Results:
+mono: timer.enabled should be False, it is False ;)
+
+How often does this happen? 
+everytime!
+
+Additional Information:
+should be easy to fix. just call Timer.Stop() @ Timer.Close() or just do
+Timer.Enabled = false.


More information about the mono-bugs mailing list