[gnome-photos] source: Don't leak the id and name when constructing from a GoaObject



commit 2b169dd5bb5025fe052940af184444e06fbb86be
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Jan 21 11:10:15 2015 +0100

    source: Don't leak the id and name when constructing from a GoaObject
    
    Using a default value of "" for the "id" and "name" properties means
    that we should g_free the defaults before assigning the values from the
    GoaObject. Let's use NULL as the default to plug this leak and save
    ourselves an extra allocation / de-allocation pair.

 src/photos-source.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-source.c b/src/photos-source.c
index e64aea4..a964591 100644
--- a/src/photos-source.c
+++ b/src/photos-source.c
@@ -232,7 +232,7 @@ photos_source_class_init (PhotosSourceClass *class)
                                    g_param_spec_string ("id",
                                                         "",
                                                         "",
-                                                        "",
+                                                        NULL,
                                                         G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
 
   g_object_class_install_property (object_class,
@@ -240,7 +240,7 @@ photos_source_class_init (PhotosSourceClass *class)
                                    g_param_spec_string ("name",
                                                         "",
                                                         "",
-                                                        "",
+                                                        NULL,
                                                         G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
 
   g_object_class_install_property (object_class,


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