gdm r6111 - in trunk: . gui/simple-greeter



Author: mccann
Date: Sat Apr  5 19:49:43 2008
New Revision: 6111
URL: http://svn.gnome.org/viewvc/gdm?rev=6111&view=rev

Log:
2008-04-05  William Jon McCann  <jmccann redhat com>

	* gui/simple-greeter/gdm-timer.c: (gdm_timer_class_init),
	(do_tick), (on_tick_timeout), (gdm_timer_queue_next_tick):
	Fix a crash when removing timeout source.



Modified:
   trunk/ChangeLog
   trunk/gui/simple-greeter/gdm-timer.c

Modified: trunk/gui/simple-greeter/gdm-timer.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-timer.c	(original)
+++ trunk/gui/simple-greeter/gdm-timer.c	Sat Apr  5 19:49:43 2008
@@ -122,6 +122,7 @@
         object_class = G_OBJECT_CLASS (klass);
 
         object_class->finalize = gdm_timer_finalize;
+
         object_class->get_property = gdm_timer_get_property;
 
         signals[TICK] = g_signal_new ("tick",
@@ -219,7 +220,7 @@
         tick_duration = current_time - time_before_tick;
 
         next_tick = MAX (frequency - tick_duration, 0.0);
-        timer->priv->tick_timeout_id = 0;
+
         gdm_timer_queue_next_tick (timer, next_tick);
 }
 
@@ -234,6 +235,8 @@
         elapsed_time = current_time - timer->priv->start_time;
         progress = elapsed_time / timer->priv->duration;
 
+        timer->priv->tick_timeout_id = 0;
+
         if (progress > 0.999) {
                 gdm_timer_stop (timer);
         } else {
@@ -244,12 +247,6 @@
 }
 
 static void
-gdm_timer_clear_timeout (GdmTimer *timer)
-{
-        timer->priv->tick_timeout_id = 0;
-}
-
-static void
 gdm_timer_queue_next_tick (GdmTimer *timer,
                            double    when)
 {
@@ -261,13 +258,9 @@
                 return;
         }
 
-        timer->priv->tick_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT,
-                                                           (guint) (when * 1000),
-                                                           (GSourceFunc)
-                                                           on_tick_timeout,
-                                                           timer,
-                                                           (GDestroyNotify)
-                                                           gdm_timer_clear_timeout);
+        timer->priv->tick_timeout_id = g_timeout_add ((guint) (when * 1000),
+                                                      (GSourceFunc) on_tick_timeout,
+                                                      timer);
 }
 
 static void



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