[Xfce4-commits] <parole:master> Fix a memory leak+reload the logo when the theme is changed.

Ali Abdallah noreply at xfce.org
Sat Nov 28 16:48:01 CET 2009


Updating branch refs/heads/master
         to aa68a2cb5e6c8162679992b5f979bf4b1d24001c (commit)
       from 1ebf2bc5c23dbd690f71bf4de60b859af42f02c2 (commit)

commit aa68a2cb5e6c8162679992b5f979bf4b1d24001c
Author: Ali Abdallah <aliov at xfce.org>
Date:   Sat Nov 28 16:21:23 2009 +0100

    Fix a memory leak+reload the logo when the theme is changed.

 gst/parole-gst.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/gst/parole-gst.c b/gst/parole-gst.c
index 660152b..ca0c8e6 100644
--- a/gst/parole-gst.c
+++ b/gst/parole-gst.c
@@ -392,6 +392,8 @@ parole_gst_draw_logo_common (ParoleGst *gst)
     gdk_window_begin_paint_region (widget->window,
 				   region);
 
+    gdk_region_destroy (region);
+
     gdk_window_clear_area (widget->window,
 			   0, 0,
 			   widget->allocation.width,
@@ -1738,6 +1740,20 @@ parole_gst_constructed (GObject *object)
 }
 
 static void
+parole_gst_style_set (GtkWidget *widget, GtkStyle *prev_style)
+{
+    ParoleGst *gst;
+    
+    gst = PAROLE_GST (widget);
+    
+    if ( gst->priv->logo )
+	g_object_unref (gst->priv->logo);
+	
+    parole_gst_load_logo (gst);
+    gtk_widget_queue_draw (widget);
+}
+
+static void
 parole_gst_class_init (ParoleGstClass *klass)
 {
     GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -1755,6 +1771,7 @@ parole_gst_class_init (ParoleGstClass *klass)
     widget_class->motion_notify_event = parole_gst_motion_notify_event;
     widget_class->button_press_event = parole_gst_button_press_event;
     widget_class->button_release_event = parole_gst_button_release_event;
+    widget_class->style_set = parole_gst_style_set;
 
     signals[MEDIA_STATE] = 
         g_signal_new ("media-state",



More information about the Xfce4-commits mailing list