Blob Blame Raw
From 6efd4960cfc57bea26fb7d169a5f600164f0bfd9 Mon Sep 17 00:00:00 2001
From: David King <amigadave@amigadave.com>
Date: Tue, 9 Sep 2014 16:50:09 +0100
Subject: [PATCH] Fix crash when animating countdown

https://bugzilla.gnome.org/show_bug.cgi?id=735285
---
 src/cheese-countdown.vala | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/cheese-countdown.vala b/src/cheese-countdown.vala
index d8f4e4f..736b0ee 100644
--- a/src/cheese-countdown.vala
+++ b/src/cheese-countdown.vala
@@ -24,6 +24,8 @@ internal class Cheese.Countdown : GLib.Object
   public delegate void CountdownCallback ();
   private Clutter.Text countdown_actor;
   private unowned CountdownCallback completed_callback;
+  private Clutter.PropertyTransition pulse_in;
+  private Clutter.PropertyTransition pulse_out;
   private int current_value = 0;
   private GLib.Settings settings;
   public bool running;
@@ -46,14 +48,13 @@ internal class Cheese.Countdown : GLib.Object
    */
   private void fade_out ()
   {
-    var pulse_out = new Clutter.PropertyTransition ("opacity");
+    pulse_out = new Clutter.PropertyTransition ("opacity");
     pulse_out.set_duration (500);
     pulse_out.set_from_value (255);
     pulse_out.set_to_value (0);
-    pulse_out.remove_on_complete = true;
     pulse_out.completed.connect (fade_in);
-
-    this.countdown_actor.add_transition ("pulse-out", pulse_out);
+    pulse_out.animatable = countdown_actor;
+    pulse_out.start ();
   }
 
   /**
@@ -72,14 +73,13 @@ internal class Cheese.Countdown : GLib.Object
     this.countdown_actor.text = this.current_value.to_string ();
     this.current_value--;
 
-    var pulse_in = new Clutter.PropertyTransition ("opacity");
+    pulse_in = new Clutter.PropertyTransition ("opacity");
     pulse_in.set_duration (500);
     pulse_in.set_from_value (0);
     pulse_in.set_to_value (255);
-    pulse_in.remove_on_complete = true;
     pulse_in.completed.connect (fade_out);
-
-    this.countdown_actor.add_transition ("pulse-in", pulse_in);
+    pulse_in.animatable = countdown_actor;
+    pulse_in.start ();
   }
 
   /**
-- 
2.1.0