[banshee] Dispose FontDescription instances (bgo#555365)



commit d1a02cbf9c8e1e587a4309d1c80e0b1fc6da2ce2
Author: Alexander Kojevnikov <alexander kojevnikov com>
Date:   Wed Feb 10 14:37:38 2010 +1100

    Dispose FontDescription instances (bgo#555365)

 .../Banshee.Sources.Gui/SourceRowRenderer.cs       |    8 +++++++-
 .../Banshee.Widgets/StreamPositionLabel.cs         |    1 +
 .../Banshee.Podcasting.Gui/ColumnCellPodcast.cs    |    1 +
 3 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
index b8ea030..11d02c8 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
@@ -190,7 +190,7 @@ namespace Banshee.Sources.Gui
             if (!hide_counts && max_title_layout_width < 0) {
                 hide_counts = true;
             }
-			
+
             title_layout.FontDescription = fd;
             title_layout.Width = (int)(max_title_layout_width * Pango.Scale.PangoScale);
             title_layout.Ellipsize = EllipsizeMode.End;
@@ -204,6 +204,8 @@ namespace Banshee.Sources.Gui
                 Middle (cell_area, title_layout_height),
                 title_layout);
 
+            title_layout.Dispose ();
+
             if (icon != null) {
                 drawable.DrawPixbuf (main_gc, icon, 0, 0,
                     cell_area.X, Middle (cell_area, icon.Height),
@@ -211,6 +213,7 @@ namespace Banshee.Sources.Gui
             }
 
             if (hide_counts) {
+                fd.Dispose ();
                 return;
             }
 
@@ -229,6 +232,9 @@ namespace Banshee.Sources.Gui
                 cell_area.X + cell_area.Width - count_layout_width - 2,
                 Middle (cell_area, count_layout_height),
                 count_layout);
+
+            count_layout.Dispose ();
+            fd.Dispose ();
         }
 
         private void RenderSelection (Gdk.Drawable drawable, Gdk.Rectangle background_area,
diff --git a/src/Core/Banshee.Widgets/Banshee.Widgets/StreamPositionLabel.cs b/src/Core/Banshee.Widgets/Banshee.Widgets/StreamPositionLabel.cs
index 4283508..15106fd 100644
--- a/src/Core/Banshee.Widgets/Banshee.Widgets/StreamPositionLabel.cs
+++ b/src/Core/Banshee.Widgets/Banshee.Widgets/StreamPositionLabel.cs
@@ -67,6 +67,7 @@ namespace Banshee.Widgets
         private void BuildLayouts ()
         {
             if (layout != null) {
+                layout.FontDescription.Dispose ();
                 layout.Dispose ();
             }
 
diff --git a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcast.cs b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcast.cs
index 169d8b1..86884e6 100644
--- a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcast.cs
+++ b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcast.cs
@@ -164,6 +164,7 @@ namespace Banshee.Podcasting.Gui
             layout.GetPixelSize (out text_w, out text_h);
             height += text_h;
 
+            layout.FontDescription.Dispose ();
             layout.Dispose ();
 
             return (height < image_size ? image_size : height) + 6;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]