[actor] Relax some of the invariants checks

When destroying a top-level actor we can actually relax the verification
of the map state, since it might be fully asynchronous and we might not
re-enter inside the mainloop in time to receive the unmap notification.
This commit is contained in:
Emmanuele Bassi 2009-05-08 17:14:49 +01:00
parent 9f3927c460
commit 91126558d3

View File

@ -558,9 +558,12 @@ clutter_actor_verify_map_state (ClutterActor *self)
{
if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL)
{
if (!CLUTTER_ACTOR_IS_VISIBLE (self))
if (!CLUTTER_ACTOR_IS_VISIBLE (self) &&
!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_DESTRUCTION))
{
g_warning ("Toplevel actor is mapped but not visible");
}
}
else
{
g_warning ("Mapped actor %s %p should have a parent",
@ -690,7 +693,9 @@ clutter_actor_update_map_state (ClutterActor *self,
break;
}
if (CLUTTER_ACTOR_IS_MAPPED (self) && !CLUTTER_ACTOR_IS_VISIBLE (self))
if (CLUTTER_ACTOR_IS_MAPPED (self) &&
!CLUTTER_ACTOR_IS_VISIBLE (self) &&
!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_DESTRUCTION))
{
g_warning ("Clutter toplevel is not visible, but is "
"somehow still mapped");
@ -1139,7 +1144,7 @@ clutter_actor_realize (ClutterActor *self)
/* To be realized, our parent actors must be realized first.
* This will only succeed if we're inside a toplevel.
*/
if (self->priv->parent_actor)
if (self->priv->parent_actor != NULL)
clutter_actor_realize (self->priv->parent_actor);
if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL)
@ -2820,9 +2825,13 @@ clutter_actor_dispose (GObject *object)
/* parent should be gone */
g_assert (priv->parent_actor == NULL);
if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL))
{
/* can't be mapped or realized with no parent */
g_assert (!CLUTTER_ACTOR_IS_MAPPED (self));
g_assert (!CLUTTER_ACTOR_IS_REALIZED (self));
}
destroy_shader_data (self);