[Mono-bugs] [Bug 70825][Nor] New - Image.Clone causes double frees in libgdiplus

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 27 Dec 2004 12:43:02 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by vargaz@gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=70825

--- shadow/70825	2004-12-27 12:43:02.000000000 -0500
+++ shadow/70825.tmp.28737	2004-12-27 12:43:02.000000000 -0500
@@ -0,0 +1,42 @@
+Bug#: 70825
+Product: Mono: Class Libraries
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Data
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vargaz@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Image.Clone causes double frees in libgdiplus
+
+The following test program causes the runtime to hang:
+
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+using System;
+using System.Drawing;
+using System.Drawing.Imaging;
+
+public class  Tests {
+
+	public static void Main () {
+		string sInFile = "Test/System.Drawing/bitmaps/almogaver24bits.bmp";
+		Bitmap	bmp2 = new Bitmap(sInFile);			
+			
+		for (int i = 0; i < 10; ++i) {
+			Bitmap bmpNew = (Bitmap) bmp2.Clone ();			
+		}
+		Console.WriteLine ("OK");
+	}
+}		
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+I think this is because GdipCloneImage doesn't clone some members of the
+image, like frameDimensionList, so GdipDisposeImage frees the same memory
+multiple times.