[folks] Work around a Vala bug generating bad C for a lambda function inside a loop



commit 5b86c16cad6bf056074bbbc0bd815d5df5fd6b70
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Mon Aug 30 15:49:17 2010 +0100

    Work around a Vala bug generating bad C for a lambda function inside a loop
    
    Helps: bgo#628335

 folks/individual-aggregator.vala |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/folks/individual-aggregator.vala b/folks/individual-aggregator.vala
index 5b81d11..968ffc9 100644
--- a/folks/individual-aggregator.vala
+++ b/folks/individual-aggregator.vala
@@ -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)
                     {



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