[Xfce4-commits] [panel-plugins/xfce4-sensors-plugin] 03/03: Fix memory issued with the tachos by now unreferencing the new'ed pango layout

noreply at xfce.org noreply at xfce.org
Sun Mar 26 23:02:40 CEST 2017


This is an automated email from the git hooks/post-receive script.

timystery pushed a commit to branch master
in repository panel-plugins/xfce4-sensors-plugin.

commit c7abccbd65fc0487c3f6d553bb73f112b7a5d693
Author: Fabian <timystery at arcor.de>
Date:   Sun Mar 26 23:01:42 2017 +0200

    Fix memory issued with the tachos by now unreferencing the new'ed pango layout
---
 lib/tacho.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tacho.c b/lib/tacho.c
index 078d16c..7f2d8ca 100644
--- a/lib/tacho.c
+++ b/lib/tacho.c
@@ -365,7 +365,6 @@ gtk_sensorstacho_paint (GtkWidget *widget,
     if (GTK_SENSORSTACHO(widget)->text != NULL) {
         PangoContext *ptr_style_context = gtk_widget_get_pango_context (widget);
         PangoLayout *ptr_layout = pango_layout_new (ptr_style_context);
-        /* TODO: Delete the pango layout when removing the widget? */
 
         pango_layout_set_alignment(ptr_layout, PANGO_ALIGN_CENTER);
         pango_layout_set_width (ptr_layout, width);
@@ -383,6 +382,7 @@ gtk_sensorstacho_paint (GtkWidget *widget,
 
         cairo_move_to (ptr_cairo, pos_xcenter, pos_ycenter - height / 2 / PANGO_SCALE);
         pango_cairo_show_layout (ptr_cairo, ptr_layout);
+        g_object_unref(ptr_layout);
     }
 
     TRACE("leave gtk_sensorstacho_paint\n");

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list