[yelp] clear the GVariantBuilder when not setting it



commit 6ee2ff5e637fa191f2434629baeed6be66bd4efb
Author: Ryan Lortie <desrt desrt ca>
Date:   Sat Mar 19 17:52:35 2011 -0400

    clear the GVariantBuilder when not setting it
    
    Otherwise it leaks.

 src/yelp-application.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/yelp-application.c b/src/yelp-application.c
index dac7bf0..7e143af 100644
--- a/src/yelp-application.c
+++ b/src/yelp-application.c
@@ -766,11 +766,10 @@ yelp_application_update_bookmarks (YelpApplication   *app,
         }
         g_variant_iter_free (iter);
 
-        if (updated) {
-            GVariant *value;
-            value = g_variant_builder_end (&builder);
-            g_settings_set_value (settings, "bookmarks", value);
-        }
+        if (updated)
+            g_settings_set (settings, "bookmarks", "a(sss)", builder);
+        else
+            g_variant_builder_clear (&builder);
     }
 }
 



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