From 6c4abde369b015489d98d07c7c24d5a8bf870d5f Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sun, 24 Jun 2012 13:29:22 -0400 Subject: [PATCH] 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. --- clutter/clutter-stage.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index 6598070d4..9e3bb8b17 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -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);