Skip to content

Commit 4ba0a2d

Browse files
committed
clutter-stage.c: Don't allocate relayout entries for detached actors.
Follow-up to 2c6b2af.
1 parent cde5c62 commit 4ba0a2d

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

clutter/clutter/clutter-stage.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,20 +1359,26 @@ clutter_stage_dequeue_actor_relayout (ClutterStage *stage,
13591359
ClutterActor *actor)
13601360
{
13611361
ClutterStagePrivate *priv = stage->priv;
1362-
GSList *l;
1362+
GSList *l = priv->pending_relayouts;
13631363

1364-
for (l = priv->pending_relayouts; l; l = l->next)
1364+
/* An actor can hold more than one entry: queue_actor_relayout() doesn't
1365+
* check for duplicates, and a size request between a queued relayout and
1366+
* the allocation that would consume it re-opens the short-circuit in
1367+
* _clutter_actor_queue_only_relayout().
1368+
*/
1369+
while (l != NULL)
13651370
{
13661371
ClutterActor *relayout_actor = l->data;
1372+
GSList *next = l->next;
13671373

13681374
if (relayout_actor == actor)
13691375
{
13701376
g_object_unref (relayout_actor);
13711377
priv->pending_relayouts =
13721378
g_slist_delete_link (priv->pending_relayouts, l);
1373-
1374-
return;
13751379
}
1380+
1381+
l = next;
13761382
}
13771383
}
13781384

@@ -1399,6 +1405,10 @@ _clutter_stage_maybe_relayout (ClutterActor *actor)
13991405
if (CLUTTER_ACTOR_IN_RELAYOUT (queued_actor)) /* avoid reentrancy */
14001406
continue;
14011407

1408+
/* An actor may have been destroyed or hidden between queuing and now */
1409+
if (clutter_actor_get_stage (queued_actor) != actor)
1410+
continue;
1411+
14021412
if (queued_actor == actor)
14031413
CLUTTER_NOTE (ACTOR, " Deep relayout of stage %s",
14041414
_clutter_actor_get_debug_name (queued_actor));

0 commit comments

Comments
 (0)