[Mono-bugs] [Bug 78285][Nor] Changed - Graphics.DrawIcon memory leak ?

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu May 4 11:57:59 EDT 2006


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=78285

--- shadow/78285	2006-05-04 05:26:18.000000000 -0400
+++ shadow/78285.tmp.20237	2006-05-04 11:57:59.000000000 -0400
@@ -1,14 +1,14 @@
 Bug#: 78285
 Product: Mono: Class Libraries
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
-Status: NEW   
+Status: NEEDINFO   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: Sys.Drawing.
 AssignedTo: peter at novonyx.com                            
 ReportedBy: xenomorph2 at onlinehome.de               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
@@ -19,6 +19,19 @@
 Graphics.DrawIcon creates a bitmap for an icon with Icon.ToBitmap() but it
 doesn't dispose the bitmap (Icon.ToBitmap always creates a new bitmap).
 
 Though, for performance reasons, it would be better to keep a reference of
 the bitmap in Icon and only create a new bitmap if the bitmap is null.
 Icons are not that big so a few more KB shouldn't matter...
+
+------- Additional Comments From sebastien at ximian.com  2006-05-04 11:57 -------
+I agreed the bitmaps should be disposed (and it's fixed in SVN r60264).
+
+But anyway the GC will (at some point) finalize the object and reclaim
+the memory - so it *shouldn't* be leaking unless there a bug elsewhere
+else. Do you have some data that show a leak ? (and not just a
+temporary retention)
+
+As for keeping a cached bitmap it could be done in Icon.ToBitmap.
+However we still must return a clone of that bitmap when asked (and
+not just a reference) as we don't know if the caller will call Dispose
+on it. Not sure if it's worth the extra code ?!?


More information about the mono-bugs mailing list