mirror of
https://github.com/brl/mutter.git
synced 2024-12-24 12:02:04 +00:00
Clear pending events for a stage when it is destroyed
We can not process events for a stage that has been destroyed so we should make sure that the events for the stage are removed from the global event queue during dispose. http://bugzilla.openedhand.com/show_bug.cgi?id=1882
This commit is contained in:
parent
49cd887aab
commit
568ad044eb
@ -704,11 +704,29 @@ clutter_stage_dispose (GObject *object)
|
|||||||
ClutterStage *stage = CLUTTER_STAGE (object);
|
ClutterStage *stage = CLUTTER_STAGE (object);
|
||||||
ClutterStagePrivate *priv = stage->priv;
|
ClutterStagePrivate *priv = stage->priv;
|
||||||
ClutterStageManager *stage_manager = clutter_stage_manager_get_default ();
|
ClutterStageManager *stage_manager = clutter_stage_manager_get_default ();
|
||||||
|
ClutterMainContext *context;
|
||||||
|
GList *l, *next;
|
||||||
|
|
||||||
clutter_actor_hide (CLUTTER_ACTOR (object));
|
clutter_actor_hide (CLUTTER_ACTOR (object));
|
||||||
|
|
||||||
_clutter_stage_manager_remove_stage (stage_manager, stage);
|
_clutter_stage_manager_remove_stage (stage_manager, stage);
|
||||||
|
|
||||||
|
context = _clutter_context_get_default ();
|
||||||
|
|
||||||
|
/* Remove any pending events for this stage from the event queue */
|
||||||
|
for (l = context->events_queue->head; l; l = next)
|
||||||
|
{
|
||||||
|
ClutterEvent *event = l->data;
|
||||||
|
|
||||||
|
next = l->next;
|
||||||
|
|
||||||
|
if (event->any.stage == stage)
|
||||||
|
{
|
||||||
|
g_queue_delete_link (context->events_queue, l);
|
||||||
|
clutter_event_free (event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (priv->impl != NULL)
|
if (priv->impl != NULL)
|
||||||
{
|
{
|
||||||
CLUTTER_NOTE (BACKEND, "Disposing of the stage implementation");
|
CLUTTER_NOTE (BACKEND, "Disposing of the stage implementation");
|
||||||
|
Loading…
Reference in New Issue
Block a user