Work around a Vala bug generating bad C for a lambda function inside a loop
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Mon, 30 Aug 2010 14:49:17 +0000 (15:49 +0100)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Mon, 30 Aug 2010 14:49:17 +0000 (15:49 +0100)
Helps: bgo#628335

folks/individual-aggregator.vala

index 5b81d11..968ffc9 100644 (file)
@@ -252,8 +252,13 @@ public class Folks.IndividualAggregator : Object
             {
               /* If we trust the PersonaStore the Persona came from, we can
                * attempt to link based on its linkable properties. */
-              foreach (string prop_name in persona.linkable_properties)
+              foreach (string foo in persona.linkable_properties)
                 {
+                  /* FIXME: If we just use string prop_name directly in the
+                   * foreach, Vala doesn't copy it into the closure data, and
+                   * prop_name ends up as NULL. bgo#628336 */
+                  string prop_name = foo;
+
                   unowned ObjectClass pclass = persona.get_class ();
                   if (pclass.find_property (prop_name) == null)
                     {