Author: spouliot
Date: 2006-03-20 16:08:02 -0500 (Mon, 20 Mar 2006)
New Revision: 58204
Modified:
trunk/mcs/class/System.Drawing/System.Drawing/Brush.cs
trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
Log:
2006-03-20 Sebastien Pouliot <[EMAIL PROTECTED]>
* Brush.cs: Allow Dispose to free the unmanaged memory for the brush
in every case. This has been known (in the past) to cause crashes
in Cairo. If still true then we need to find out why!
Modified: trunk/mcs/class/System.Drawing/System.Drawing/Brush.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/Brush.cs 2006-03-20
20:45:36 UTC (rev 58203)
+++ trunk/mcs/class/System.Drawing/System.Drawing/Brush.cs 2006-03-20
21:08:02 UTC (rev 58204)
@@ -100,7 +100,9 @@
protected virtual void Dispose (bool disposing)
{
- if ((GDIPlus.Display != IntPtr.Zero) && (nativeObject
!= IntPtr.Zero)) {
+ // NOTE: this has been known to fail in the past (cairo)
+ // but it's the only way to reclaim brush related memory
+ if (nativeObject != IntPtr.Zero) {
GDIPlus.GdipDeleteBrush (nativeObject);
nativeObject = IntPtr.Zero;
}
Modified: trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog 2006-03-20
20:45:36 UTC (rev 58203)
+++ trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog 2006-03-20
21:08:02 UTC (rev 58204)
@@ -1,3 +1,9 @@
+2006-03-20 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * Brush.cs: Allow Dispose to free the unmanaged memory for the brush
+ in every case. This has been known (in the past) to cause crashes
+ in Cairo. If still true then we need to find out why!
+
2006-03-09 Peter Dennis Bartok <[EMAIL PROTECTED]>
* gdipFunctions.cs: Removed XCloseDisplay call from Gdi+ shutdown,
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches