Avoid warnings on ClutterClone with a NULL source
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sun, 24 Oct 2010 12:45:16 +0000 (14:45 +0200)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Mon, 25 Oct 2010 11:36:00 +0000 (12:36 +0100)
clutter_clone_apply_transform should check the source before calling
methods on it, else criticals will be emitted.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2381

clutter/clutter-clone.c

index bb63905..e604e21 100644 (file)
@@ -133,6 +133,10 @@ clutter_clone_apply_transform (ClutterActor *self, CoglMatrix *matrix)
   CLUTTER_ACTOR_CLASS (clutter_clone_parent_class)->apply_transform (self,
                                                                      matrix);
 
+  /* if we don't have a source, nothing else to do */
+  if (priv->clone_source == NULL)
+    return;
+
   /* get our allocated size */
   clutter_actor_get_allocation_geometry (self, &geom);