stage: Make sure to free any pending queued redraws if we have any

This fixes a memory leak when someone creates a stage and then immediately
destroys it.
This commit is contained in:
Jasper St. Pierre 2012-06-24 13:29:22 -04:00
parent ab88511133
commit 6c4abde369

View File

@ -212,6 +212,7 @@ static guint stage_signals[LAST_SIGNAL] = { 0, };
static const ClutterColor default_stage_color = { 255, 255, 255, 255 };
static void _clutter_stage_maybe_finish_queue_redraws (ClutterStage *stage);
static void free_queue_redraw_entry (ClutterStageQueueRedrawEntry *entry);
static void
clutter_stage_real_add (ClutterContainer *container,
@ -1813,6 +1814,10 @@ clutter_stage_dispose (GObject *object)
clutter_actor_remove_all_children (CLUTTER_ACTOR (object));
g_list_free_full (priv->pending_queue_redraws,
(GDestroyNotify) free_queue_redraw_entry);
priv->pending_queue_redraws = NULL;
/* this will release the reference on the stage */
stage_manager = clutter_stage_manager_get_default ();
_clutter_stage_manager_remove_stage (stage_manager, stage);