From: Michael Dominic Kostrzewa Date: Thu, 3 May 2007 11:44:54 +0000 (+0000) Subject: The VVolumebar example now uses slightly bigger height. Adding some checks before... X-Git-Tag: 2.1.66-1~888 X-Git-Url: http://git.maemo.org/git/?a=commitdiff_plain;h=74f73a593bfc6b6ba5d3dd4b0973dcf0f100163d;p=hildon The VVolumebar example now uses slightly bigger height. Adding some checks before freeing memory in the font selection dialog. --- diff --git a/ChangeLog b/ChangeLog index 86cea6c..edbc9d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-05-03 Michael Dominic Kostrzewa + + * examples/hildon-vvolumebar-example.c: The VVolumebar example now + uses slightly bigger height. + + * src/hildon-font-selection-dialog.c: Adding some checks before + freeing memory in the font selection dialog. + 2007-05-02 Michael Dominic Kostrzewa * src/hildon-font-selection-dialog.c: Adding a small check when diff --git a/examples/hildon-vvolumebar-example.c b/examples/hildon-vvolumebar-example.c index d837513..87eb31c 100644 --- a/examples/hildon-vvolumebar-example.c +++ b/examples/hildon-vvolumebar-example.c @@ -37,7 +37,7 @@ main (int argc, GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ()); HildonVVolumebar *bar = HILDON_VVOLUMEBAR (hildon_vvolumebar_new ()); - gtk_widget_set_size_request (GTK_WIDGET (bar), -1, 200); + gtk_widget_set_size_request (GTK_WIDGET (bar), -1, 300); gtk_box_pack_start (GTK_BOX (dialog->vbox), GTK_WIDGET (bar), FALSE, FALSE, 0); gtk_dialog_add_button (dialog, "Close", GTK_RESPONSE_CLOSE); diff --git a/src/hildon-font-selection-dialog.c b/src/hildon-font-selection-dialog.c index c2373f5..777662c 100644 --- a/src/hildon-font-selection-dialog.c +++ b/src/hildon-font-selection-dialog.c @@ -1159,7 +1159,9 @@ hildon_font_selection_dialog_show_preview (HildonFontSelectionDialog *font preview_label = gtk_label_new (str); gtk_label_set_line_wrap (GTK_LABEL(preview_label), TRUE); - g_free (str); + if (str) + g_free (str); + str = NULL; gtk_container_add (GTK_CONTAINER (GTK_DIALOG(preview_dialog)->vbox), @@ -1171,7 +1173,7 @@ hildon_font_selection_dialog_show_preview (HildonFontSelectionDialog *font G_CALLBACK(hildon_font_selection_dialog_preview_key_press), NULL); - /*Set the font*/ + /* Set the font */ list = (show_ref) ? hildon_font_selection_dialog_create_attrlist (fontsel, strlen (_("ecdg_fi_preview_font_preview_reference")), strlen (priv->preview_text)) : @@ -1195,9 +1197,12 @@ hildon_font_selection_dialog_show_preview (HildonFontSelectionDialog *font attr = pango_attr_family_new (str); add_preview_text_attr (list, attr, 0, strlen (_("ecdg_fi_preview_font_preview_reference"))); } - g_free (str); + if (str != NULL) + g_free (str); + + str = NULL; - /*size*/ + /* size */ if (size_set) { attr = pango_attr_size_new (size * PANGO_SCALE);