f-spot r4466 - in branches/FSPOT_0_5_0_STABLE: . src



Author: sdelcroix
Date: Sat Oct  4 11:45:14 2008
New Revision: 4466
URL: http://svn.gnome.org/viewvc/f-spot?rev=4466&view=rev

Log:
2008-10-04  Stephane Delcroix  <sdelcroix novell com>

	* src/PixbufUtils.cs: fix the leakage on GetSize ();

Modified:
   branches/FSPOT_0_5_0_STABLE/ChangeLog
   branches/FSPOT_0_5_0_STABLE/src/PixbufUtils.cs

Modified: branches/FSPOT_0_5_0_STABLE/src/PixbufUtils.cs
==============================================================================
--- branches/FSPOT_0_5_0_STABLE/src/PixbufUtils.cs	(original)
+++ branches/FSPOT_0_5_0_STABLE/src/PixbufUtils.cs	Sat Oct  4 11:45:14 2008
@@ -214,6 +214,12 @@
 		
 	static public void GetSize (string path, out int width, out int height)
 	{
+#if true
+		using (Gdk.Pixbuf pixbuf = new Gdk.Pixbuf (path)) {
+			width = pixbuf.Width;
+			height = pixbuf.Height;
+		}
+#else //yes, the pixbuf loader hack is smarter, but it leaks like an old women
 		Gdk.PixbufLoader loader = new Gdk.PixbufLoader ();
 		int orig_width = 0;
 		int orig_height = 0;
@@ -237,6 +243,7 @@
 		
 		width = orig_width;
 		height = orig_height;
+#endif
 	}
 
 	static public Pixbuf LoadAtMaxSize (string path, int max_width, int max_height)



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