+2008-04-09 Neil Roberts <neil@o-hand.com>
+
+ Applied patch from bug #871
+
+ * clutter/x11/clutter-backend-x11.c (clutter_backend_x11_dispose):
+ Call g_slist_foreach instead of iterating over the stage_manager
+ list manually when deleting stages. Otherwise the 'next' pointer
+ of the list node can get corrupted when the actor removes itself
+ from the list.
+
+ * clutter/clutter-stage.c (clutter_stage_dispose): Call
+ clutter_actor_unrealize in the dispose handler. This fixes
+ problems where the dispose handler for the ClutterStageWrapper
+ can't deselect the GL context until the stage is unrealized.
+
2008-04-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-backend.c: Add more debug messages
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (gobject);
ClutterMainContext *context;
ClutterStageManager *stage_manager;
- GSList *l;
CLUTTER_NOTE (BACKEND, "Disposing the of stages");
context = clutter_context_get_default ();
stage_manager = context->stage_manager;
- for (l = stage_manager->stages; l; l = l->next)
- {
- ClutterActor *stage = CLUTTER_ACTOR (l->data);
- clutter_actor_destroy (stage);
- }
+ /* Destroy all of the stages. g_slist_foreach is used because the
+ finalizer for the stages will remove the stage from the
+ stage_manager's list and g_slist_foreach has some basic
+ protection against this */
+ g_slist_foreach (stage_manager->stages, (GFunc) clutter_actor_destroy, NULL);
CLUTTER_NOTE (BACKEND, "Removing the event source");
_clutter_backend_x11_events_uninit (CLUTTER_BACKEND (backend_x11));