f-spot r4465 - in trunk: . src



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

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

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

Modified:
   trunk/ChangeLog
   trunk/src/PixbufUtils.cs

Modified: trunk/src/PixbufUtils.cs
==============================================================================
--- trunk/src/PixbufUtils.cs	(original)
+++ trunk/src/PixbufUtils.cs	Sat Oct  4 11:26:13 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]