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:
parent
ab88511133
commit
6c4abde369
@ -212,6 +212,7 @@ static guint stage_signals[LAST_SIGNAL] = { 0, };
|
|||||||
static const ClutterColor default_stage_color = { 255, 255, 255, 255 };
|
static const ClutterColor default_stage_color = { 255, 255, 255, 255 };
|
||||||
|
|
||||||
static void _clutter_stage_maybe_finish_queue_redraws (ClutterStage *stage);
|
static void _clutter_stage_maybe_finish_queue_redraws (ClutterStage *stage);
|
||||||
|
static void free_queue_redraw_entry (ClutterStageQueueRedrawEntry *entry);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_real_add (ClutterContainer *container,
|
clutter_stage_real_add (ClutterContainer *container,
|
||||||
@ -1813,6 +1814,10 @@ clutter_stage_dispose (GObject *object)
|
|||||||
|
|
||||||
clutter_actor_remove_all_children (CLUTTER_ACTOR (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 */
|
/* this will release the reference on the stage */
|
||||||
stage_manager = clutter_stage_manager_get_default ();
|
stage_manager = clutter_stage_manager_get_default ();
|
||||||
_clutter_stage_manager_remove_stage (stage_manager, stage);
|
_clutter_stage_manager_remove_stage (stage_manager, stage);
|
||||||
|
Loading…
Reference in New Issue
Block a user