A few more GdkColor struct allocation fixes straight from Tommi labs.
authorMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Mon, 21 May 2007 10:54:20 +0000 (10:54 +0000)
committerMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Mon, 21 May 2007 10:54:20 +0000 (10:54 +0000)
ChangeLog
src/hildon-color-chooser-dialog.c
src/hildon-color-chooser.c

index aea1724..61ac1cb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2007-05-21  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
 
+       * src/hildon-color-chooser-dialog.c:
+       * src/hildon-color-chooser.c: A few more GdkColor struct allocation fixes
+       straight from Tommi labs.
+
+2007-05-21  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
+
        * examples/hildon-finger-example.c: Correcting the header file path.
 
        * src/hildon-color-chooser-dialog.c: Allocate the color on the stack for 
index 831b8a4..9371503 100644 (file)
@@ -516,6 +516,7 @@ hildon_color_chooser_dialog_style_set           (GtkWidget *widget,
 
     if (tmpcolor) {
         priv->style_info.default_color = *tmpcolor;
+       gdk_color_free (tmpcolor);
     } else {
         priv->style_info.default_color.red   = 0x0000;
         priv->style_info.default_color.green = 0x0000;
@@ -593,6 +594,7 @@ hildon_color_chooser_dialog_style_set           (GtkWidget *widget,
 
         if (tmpcolor) {
             priv->colors_defined[i] = *tmpcolor;
+           gdk_color_free (tmpcolor);
         } else {
             if(i < 16) {
                 priv->colors_defined[i] = hardcoded_colors[i];
index 01d238d..92bcc69 100644 (file)
@@ -1321,9 +1321,9 @@ hildon_color_chooser_get_property               (GObject *object,
     {
 
         case PROP_COLOR: {
-            GdkColor *color = g_new (GdkColor, 1);
-            hildon_color_chooser_get_color ((HildonColorChooser *) object, color);
-            g_value_take_boxed (value, color);
+            GdkColor color;
+            hildon_color_chooser_get_color ((HildonColorChooser *) object, &color);
+            g_value_set_boxed (value, &color);
             } break;
 
         default: