* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; version 2.1 of
- * the License.
+ * the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
for (i = 0; i < tmp; i++) {
g_object_unref (priv->gc_array[i]);
+ priv->gc_array[i] = NULL;
}
GTK_WIDGET_CLASS (parent_class)->unrealize (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;
for (i = 0; i < tmpn; i++) {
g_object_unref (priv->gc_array[i]);
+ priv->gc_array[i] = NULL;
}
}
(priv->style_info.num_buttons.top * priv->style_info.num_buttons.bottom);
priv->gc_array = (GdkGC **) g_malloc0 (sizeof (GdkGC *) * tmpn);
+ if (GTK_WIDGET_REALIZED (widget)) {
+ for (i = 0; i < tmpn; i++) {
+ priv->gc_array[i] = gdk_gc_new (widget->window);
+ }
+ }
if (priv->gconf_client) {
if (tmpcolor) {
priv->colors_defined[i] = *tmpcolor;
+ gdk_color_free (tmpcolor);
} else {
if(i < 16) {
priv->colors_defined[i] = hardcoded_colors[i];
HildonColorChooserDialogPrivate *priv = HILDON_COLOR_CHOOSER_DIALOG_GET_PRIVATE (data);
char key[128], color_str[13];
int tmp;
- GdkColor *color = g_new (GdkColor, 1);
+ GdkColor color;
g_assert (priv);
- hildon_color_chooser_get_color (chooser, color);
+ hildon_color_chooser_get_color (chooser, &color);
tmp = (priv->style_info.num_buttons.left * priv->style_info.num_buttons.right);
if (priv->selected >= tmp) {
- priv->colors_custom[priv->selected - tmp] = *color;
+ priv->colors_custom[priv->selected - tmp] = color;
gdk_gc_set_rgb_fg_color (priv->gc_array[priv->selected], &priv->colors_custom[priv->selected - tmp]);
gtk_widget_queue_draw (priv->area_custom);
if (tmp1) {
priv->style_info.cont_sizes = *tmp1;
- g_free (tmp1);
+ gtk_border_free (tmp1);
} else {
priv->style_info.cont_sizes.left = 0;
priv->style_info.cont_sizes.right = 8;
if (tmp2) {
priv->style_info.radio_sizes = *tmp2;
- g_free (tmp2);
+ gtk_border_free (tmp2);
} else {
priv->style_info.radio_sizes.left = 16;
priv->style_info.radio_sizes.right = 16;
if (tmp3) {
priv->style_info.num_buttons = *tmp3;
- g_free (tmp3);
+ gtk_border_free (tmp3);
} else {
priv->style_info.num_buttons.left = 8;
priv->style_info.num_buttons.right = 2;