[Mono-bugs] [Bug 80552][Nor] Changed - [Windows] Font.ToHfont leaks GDI objects

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jan 18 19:25:13 EST 2007


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 sebastien at ximian.com.

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

--- shadow/80552	2007-01-18 18:24:38.000000000 -0500
+++ shadow/80552.tmp.3168	2007-01-18 19:25:13.000000000 -0500
@@ -1,17 +1,17 @@
 Bug#: 80552
 Product: Mono: Class Libraries
 Version: 1.2
-OS: 
-OS Details: WinXPSP2
+OS: Windows XP
+OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
-Priority: Major
+Severity: Unknown
+Priority: Normal
 Component: Sys.Drawing.
-AssignedTo: mono-bugs at ximian.com                            
+AssignedTo: sebastien at ximian.com                            
 ReportedBy: monkey at jpobst.com               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
 Summary: [Windows] Font.ToHfont leaks GDI objects
@@ -27,6 +27,21 @@
 GDI objects in use.
 
 ------- Additional Comments From monkey at jpobst.com  2007-01-18 18:24 -------
 Created an attachment (id=18518)
 Test Form
 
+
+------- Additional Comments From sebastien at ximian.com  2007-01-18 19:25 -------
+The ToHFont code is bad, but then so is is the sample code ;-)
+
+A font instance, once created, can't change. So it's HFONT stays the
+same[1]. Calling DeleteObject on it, the first time, is probably
+bad[2], calling it multiple times is bad (but generally Windows
+doesn't mind, at least for most handles).
+
+Now that doesn't explains where all the GDI objects come from :-(
+
+[1] the current code, under win32 (unix case is fine), create the new
+handle again and again. I'm fixing that...
+
+[2] Pretty sure the .NET Font instance is ok but I need to test that...


More information about the mono-bugs mailing list