f-spot r4635 - in trunk: . src/Core



Author: sdelcroix
Date: Wed Nov 26 14:13:24 2008
New Revision: 4635
URL: http://svn.gnome.org/viewvc/f-spot?rev=4635&view=rev

Log:
protect the event against race conditions

2008-11-26  Stephane Delcroix  <sdelcroix novell com>

	* src/Core/Animator.cs: protect the event against null or race conditions

Modified:
   trunk/ChangeLog
   trunk/src/Core/Animator.cs

Modified: trunk/src/Core/Animator.cs
==============================================================================
--- trunk/src/Core/Animator.cs	(original)
+++ trunk/src/Core/Animator.cs	Wed Nov 26 14:13:24 2008
@@ -49,8 +49,9 @@
 		public bool HandleTimeout ()
 		{
 			percent = (DateTime.Now - start).Ticks / (float) duration.Ticks;
-			if (tick != null)
-				tick (this, EventArgs.Empty);
+			EventHandler tick_handler = tick;
+			if (tick_handler != null)
+				tick_handler (this, EventArgs.Empty);
 
 			return delay.IsPending;
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]