02296a
From 6efd4960cfc57bea26fb7d169a5f600164f0bfd9 Mon Sep 17 00:00:00 2001
02296a
From: David King <amigadave@amigadave.com>
02296a
Date: Tue, 9 Sep 2014 16:50:09 +0100
02296a
Subject: [PATCH] Fix crash when animating countdown
02296a
02296a
https://bugzilla.gnome.org/show_bug.cgi?id=735285
02296a
---
02296a
 src/cheese-countdown.vala | 16 ++++++++--------
02296a
 1 file changed, 8 insertions(+), 8 deletions(-)
02296a
02296a
diff --git a/src/cheese-countdown.vala b/src/cheese-countdown.vala
02296a
index d8f4e4f..736b0ee 100644
02296a
--- a/src/cheese-countdown.vala
02296a
+++ b/src/cheese-countdown.vala
02296a
@@ -24,6 +24,8 @@ internal class Cheese.Countdown : GLib.Object
02296a
   public delegate void CountdownCallback ();
02296a
   private Clutter.Text countdown_actor;
02296a
   private unowned CountdownCallback completed_callback;
02296a
+  private Clutter.PropertyTransition pulse_in;
02296a
+  private Clutter.PropertyTransition pulse_out;
02296a
   private int current_value = 0;
02296a
   private GLib.Settings settings;
02296a
   public bool running;
02296a
@@ -46,14 +48,13 @@ internal class Cheese.Countdown : GLib.Object
02296a
    */
02296a
   private void fade_out ()
02296a
   {
02296a
-    var pulse_out = new Clutter.PropertyTransition ("opacity");
02296a
+    pulse_out = new Clutter.PropertyTransition ("opacity");
02296a
     pulse_out.set_duration (500);
02296a
     pulse_out.set_from_value (255);
02296a
     pulse_out.set_to_value (0);
02296a
-    pulse_out.remove_on_complete = true;
02296a
     pulse_out.completed.connect (fade_in);
02296a
-
02296a
-    this.countdown_actor.add_transition ("pulse-out", pulse_out);
02296a
+    pulse_out.animatable = countdown_actor;
02296a
+    pulse_out.start ();
02296a
   }
02296a
 
02296a
   /**
02296a
@@ -72,14 +73,13 @@ internal class Cheese.Countdown : GLib.Object
02296a
     this.countdown_actor.text = this.current_value.to_string ();
02296a
     this.current_value--;
02296a
 
02296a
-    var pulse_in = new Clutter.PropertyTransition ("opacity");
02296a
+    pulse_in = new Clutter.PropertyTransition ("opacity");
02296a
     pulse_in.set_duration (500);
02296a
     pulse_in.set_from_value (0);
02296a
     pulse_in.set_to_value (255);
02296a
-    pulse_in.remove_on_complete = true;
02296a
     pulse_in.completed.connect (fade_out);
02296a
-
02296a
-    this.countdown_actor.add_transition ("pulse-in", pulse_in);
02296a
+    pulse_in.animatable = countdown_actor;
02296a
+    pulse_in.start ();
02296a
   }
02296a
 
02296a
   /**
02296a
-- 
02296a
2.1.0
02296a