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.
This commit is contained in:
Neil Roberts 2008-04-09 09:33:32 +00:00
parent f16833ea6d
commit b4ab8b63a1
3 changed files with 22 additions and 6 deletions

View File

@ -1,3 +1,18 @@
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

View File

@ -363,6 +363,8 @@ clutter_stage_dispose (GObject *object)
priv->update_idle = 0;
}
clutter_actor_unrealize (CLUTTER_ACTOR (object));
_clutter_stage_manager_remove_stage (stage_manager, stage);
if (priv->impl)

View File

@ -242,18 +242,17 @@ clutter_backend_x11_dispose (GObject *gobject)
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));