[clutter/clutter-1.10] stage: Make sure to free any pending queued redraws if we have any



commit 6523f804c0b7ca7357525c1b48f08c51fb689130
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Jun 24 13:29:22 2012 -0400

    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.
    (cherry picked from commit 6c4abde369b015489d98d07c7c24d5a8bf870d5f)
    
    Signed-off-by: Emmanuele Bassi <ebassi gnome org>

 clutter/clutter-stage.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index 6472a27..6e7c52c 100644
--- a/clutter/clutter-stage.c
+++ b/clutter/clutter-stage.c
@@ -213,6 +213,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,
@@ -1817,6 +1818,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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]