[clutter] actor: Avoid popping the easing state stack once too many



commit 05f78306d18a5107d194445882cae5afae3eab7f
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Sat Mar 17 16:49:35 2012 +0000

    actor: Avoid popping the easing state stack once too many
    
    If restore_easing_state() is called on the last easing state on the
    stack, clean up the stack, so that we don't leave stale pointers
    around to later segfault on.

 clutter/clutter-actor.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index e4de191..24c7606 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -17516,7 +17516,14 @@ clutter_actor_restore_easing_state (ClutterActor *self)
     }
 
   g_array_remove_index (info->states, info->states->len - 1);
-  info->cur_state = &g_array_index (info->states, AState, info->states->len - 1);
+
+  if (info->states->len > 0)
+    info->cur_state = &g_array_index (info->states, AState, info->states->len - 1);
+  else
+    {
+      g_array_unref (info->states);
+      info->states = NULL;
+    }
 }
 
 /**



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