[clutter] Fixed clutter_state_remove_key_internal() to propagate the is_inert state
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] Fixed clutter_state_remove_key_internal() to propagate the is_inert state
- Date: Mon, 6 Feb 2012 15:43:24 +0000 (UTC)
commit ad276865d2874b53311840eee79dd4d41ef2dc77
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Sun Jan 29 21:29:38 2012 +0900
Fixed clutter_state_remove_key_internal() to propagate the is_inert state
This was causing warnings when calling g_object_weak_unref on an
already finalized object.
https://bugzilla.gnome.org/show_bug.cgi?id=668951
clutter/clutter-state.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/clutter/clutter-state.c b/clutter/clutter-state.c
index 6085b3a..9c2db6d 100644
--- a/clutter/clutter-state.c
+++ b/clutter/clutter-state.c
@@ -432,12 +432,15 @@ again_from_start:
/* Go through each TargetState */
if (target_state)
{
- GList *k;
-again_for_target_state:
- for (k = target_state->keys; k != NULL; k = k->next)
+ GList *k = target_state->keys;
+
+ /* Note the safe while() loop, because we modify the list inline */
+ while (k != NULL)
{
ClutterStateKey *key = k->data;
+ k = k->next;
+
/* Check if each key matches query */
if ( (object == NULL || (object == key->object))
&& (source_state == NULL || (source_state == key->source_state))
@@ -456,13 +459,12 @@ again_for_target_state:
clutter_state_set_state (this, NULL);
/* remove any keys that exist that uses this state as a source */
- clutter_state_remove_key (this, s->data, NULL, NULL, NULL);
+ clutter_state_remove_key_internal (this, s->data, NULL, NULL, NULL, is_inert);
g_hash_table_remove (this->priv->states, s->data);
goto again_from_start; /* we have just freed State *target_state, so
need to restart removal */
}
- goto again_for_target_state;
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]