[libchamplain] Add assertion on tile's content



commit 887639e8355ff5e4034dcb7a133f320284448c8f
Author: Pierre-Luc Beaudoin <pierre-luc pierlux com>
Date:   Mon May 18 14:17:37 2009 -0400

    Add assertion on tile's content

 champlain/champlain-tile.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
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;



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