[gnome-photos/wip/rishi/use-g-auto-01: 5/5] print-setup: Use g_auto*
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/use-g-auto-01: 5/5] print-setup: Use g_auto*
- Date: Sat, 27 Mar 2021 19:45:15 +0000 (UTC)
commit 249eda3e39a793b8a3a72ea070c1e837f08ad4b8
Author: Debarshi Ray <debarshir gnome org>
Date: Sat Mar 27 20:38:46 2021 +0100
print-setup: Use g_auto*
https://gitlab.gnome.org/GNOME/gnome-photos/issues/77
src/photos-print-setup.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/src/photos-print-setup.c b/src/photos-print-setup.c
index 81e1c021..326707fb 100644
--- a/src/photos-print-setup.c
+++ b/src/photos-print-setup.c
@@ -701,7 +701,7 @@ photos_print_setup_wrap_in_frame (const gchar *label, GtkWidget *child)
{
GtkWidget *frame;
GtkWidget *label_widget;
- gchar *bold_text;
+ g_autofree gchar *bold_text = NULL;
label_widget = gtk_label_new ("");
gtk_label_set_xalign (GTK_LABEL (label_widget), 0.0);
@@ -709,7 +709,6 @@ photos_print_setup_wrap_in_frame (const gchar *label, GtkWidget *child)
bold_text = g_markup_printf_escaped ("<b>%s</b>", label);
gtk_label_set_markup (GTK_LABEL (label_widget), bold_text);
- g_free (bold_text);
frame = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (frame), label_widget, FALSE, FALSE, 0);
@@ -838,15 +837,12 @@ photos_print_setup_set_property (GObject *object, guint prop_id, const GValue *v
{
case PROP_NODE:
{
- GdkPixbuf *pixbuf;
+ g_autoptr (GdkPixbuf) pixbuf = NULL;
self->node = GEGL_NODE (g_value_dup_object (value));
pixbuf = photos_gegl_create_pixbuf_from_node (self->node);
if (pixbuf != NULL)
- {
- g_object_set (self->preview, "pixbuf", pixbuf, NULL);
- g_object_unref (pixbuf);
- }
+ g_object_set (self->preview, "pixbuf", pixbuf, NULL);
}
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]