banshee r3929 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Collection.Gui



Author: abock
Date: Mon May 19 17:41:34 2008
New Revision: 3929
URL: http://svn.gnome.org/viewvc/banshee?rev=3929&view=rev

Log:
2008-05-19  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs:
    Added native handle NULL checks when checking for null against a Gdk.Pixbuf;
    for some reason we sometimes get a managed GdkPixbuf object that wraps
    a NULL native GdkPixbuf pointer - possibly a bug in Gdk# - though it only
    seems to happen when image data comes from the Net, so it could just be
    a case of bad things happening with bad image data



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs	Mon May 19 17:41:34 2008
@@ -49,7 +49,7 @@
             double x, double y, double width, double height, bool drawBorder, double radius, 
             bool fill, Color fillColor)
         {
-            if (pixbuf == null) {
+            if (pixbuf == null || pixbuf.Handle == IntPtr.Zero) {
                 return;
             }
             
@@ -94,7 +94,7 @@
         
         public static void DisposePixbuf (Gdk.Pixbuf pixbuf)
         {
-            if (pixbuf != null) {
+            if (pixbuf != null && pixbuf.Handle != IntPtr.Zero) {
                 pixbuf.Dispose ();
                 pixbuf = null;
                 GC.Collect ();



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