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.
}
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;
+ }
}
/**