From: Pierre-Luc Beaudoin Date: Mon, 18 May 2009 18:17:37 +0000 (-0400) Subject: Add assertion on tile's content X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=887639e8355ff5e4034dcb7a133f320284448c8f;p=libchamplain Add assertion on tile's content --- diff --git a/champlain/champlain-tile.c b/champlain/champlain-tile.c index 5bab7c5..b666b7e 100644 --- a/champlain/champlain-tile.c +++ b/champlain/champlain-tile.c @@ -838,8 +838,8 @@ fade_in_completed (ClutterAnimation *animation, if (ctx->old_actor != NULL) { - g_object_unref (ctx->old_actor); clutter_container_remove (CLUTTER_CONTAINER (priv->actor), ctx->old_actor, NULL); + g_object_unref (ctx->old_actor); } g_object_unref (ctx->tile); @@ -870,6 +870,10 @@ champlain_tile_set_content (ChamplainTile *self, if (priv->content_actor != NULL) { + /* it sometimes happen that the priv->content_actor has been destroyed, + * this assert will help determine when with no impact on the user */ + g_assert (CLUTTER_IS_ACTOR (priv->content_actor)); + if (fade_in == TRUE) old_actor = g_object_ref (priv->content_actor); else @@ -879,7 +883,6 @@ champlain_tile_set_content (ChamplainTile *self, clutter_container_add (CLUTTER_CONTAINER (priv->actor), actor, NULL); - /* fixme: etemplate are leaked here */ if (fade_in == TRUE) { ClutterAnimation *animation;